Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Give this a try:</p> <pre><code>mkfifo alt_in (tail -f alt_in &amp; rlwrap cat) | bash </code></pre> <p>You won't get a prompt, but you can enter commands and use arrow keys, etc., including history retrieval. You can <code>echo</code> commands from another terminal into the named pipe and they'll be executed at the receiving end, but they won't be in its history.</p> <p>Some other things to investigate:</p> <ul> <li>expect</li> <li>screen -x and screen -X</li> </ul> <p>For the latter, in one terminal start <code>screen</code>. You'll be able to interact with Bash there pretty much as you normally would. Now on another terminal, do</p> <pre><code>screen -ls </code></pre> <p>to determine the PID of the <code>screen</code> session you started. It will be the digits at the start of a line that looks like this:</p> <pre><code>31544.pts-2.hostname (01/01/2010 01:01:01 PM) (Attached) </code></pre> <p>Now you can do things like this:</p> <pre><code>screen -S 31544 -X stuff $'echo Your ad here.\n' </code></pre> <p>which will cause the <code>echo</code> command to be executed on the other terminal. The <code>$''</code> causes the escape sequences within to be interpreted, in this case giving us a newline so we can "press" <kbd>Enter</kbd>.</p> <p>Let's say we did this:</p> <pre><code>screen -S 31544 -X stuff $'top\n' </code></pre> <p>Now <code>top</code> is running. We could go to that terminal and press <kbd>q</kbd> to quit, but where's the fun in that?</p> <pre><code>screen -S 31544 -X stuff 'q' </code></pre> <p>Notice this time we didn't need a newline.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload