Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    script change keyboard mapping?


    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?



  2. #2
    in perl:


    use strict;

    my @userinput = <STDIN>;
    foreach (@userinput) { print; }

    wonder if there's a way in bash?

  3. #3
    Linux Newbie
    Join Date
    Apr 2010
    Novosibirsk, Russia
    I suppose, you could just read line by line using `read`command and check if string contains some special character, using `grep`

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts