Results 1 to 3 of 3
Hello,
Not sure if the title is appropriate, but here is what I would like to do:
script running in terminal pauses and waits for user input.
user is able ...
- 02-23-2011 #1Just Joined!
- Join Date
- Jan 2007
- Posts
- 19
script change keyboard mapping?
Hello,
Not sure if the title is appropriate, but here is what I would like to do:
script running in terminal pauses and waits for user input.
user is able to input strings with linebreaks, ie, types a line, hit return, types another line, return, and as he is doing this, the lines appear on the screen like they would in an editor:
line 1
line 2
line 3
...
presses some other key (combination) to send the input to the script.
Is this possible? I have been looking into stty, but my experiments haven't come up with anything useful. Maybe some utility like tput, except for tty?
Thanks,
Allasso
- 02-23-2011 #2Just Joined!
- Join Date
- Jan 2007
- Posts
- 19
in perl:
#!/usr/bin/perl
use strict;
my @userinput = <STDIN>;
foreach (@userinput) { print; }
wonder if there's a way in bash?
- 02-26-2011 #3Linux Newbie
- Join Date
- Apr 2010
- Location
- Novosibirsk, Russia
- Posts
- 136
I suppose, you could just read line by line using `read`command and check if string contains some special character, using `grep`


Reply With Quote