Results 1 to 2 of 2

Thread: redirect input terminal

  1. #1
    Join Date
    Sep 2011
    Beans
    35

    redirect input terminal

    hy,
    in a terminal i open a new terminal:
    Code:
    gnome-terminal
    now i have 2 terminal: the main terminal and the second terminal.
    Can i redirect the keyboard input from the main to the second?

    Example:
    Main terminal:
    Code:
    echo hello world
    second terminal:
    Code:
    hello world

  2. #2
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    4,267
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: redirect input terminal

    You can redirect both input and output for child processes using coproc. However, it does not work for a Bash terminal, because the input and output are internal to the terminal.

    You could have output from the second terminal redirect to a file (I suggest a RAM file; create a temporary file in /run/shm using mktemp), and have the first terminal watch for changes to the file using tail --follow or inotifywait.
    Problems with WINE?
    Full Circle Magazine :: Confused "allot"? :: Cheap Linux stickers
    In my day, we had outdoors in which to run, play, and socialise. Now we have computers to do those.

Bookmarks

Posting Permissions

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