Note that there are some explanatory texts on larger screens.

plurals
  1. POProblems in sending input to detached 'screen' via readreg and paste
    primarykey
    data
    text
    <p>I am trying to send input to a interactive command running via screen. Here is my initial command</p> <pre><code>screen -L -c ./customrc -S psql -d -m /opt/PostgreSQL/9.0/bin/psql </code></pre> <p>The above command will run interactive psql in screen detach mode. The customrc is used to define a log file for the output (which I will read from another process by polling)</p> <p>I am using following two commands to send input to psql running in screen</p> <pre><code>screen -S psql -X readreg p psqlcommands.sql screen -S psql -X paste p </code></pre> <p>The problem is that the above commands do not work unless I reattach screen at least once. Once I have attached screen and detached, the above commands work as expected. I have to launch these commands via background java process hence the interactive shell (bash) is not available. My goal is to run psql in interactive mode and pass input to it and capture its output via a log file.</p> <p>So far I have tried to run screen via xterm (or konsole or gnome-terminal) in attach mode, use readreg/paste and then detach, but I realise that xterm will not be available in my production environment. I've also tried sending output to /proc//fd/0 but I am unable to emulate 'ENTER' from keyboard (I have to attach and press in order for the output to be accepted by psql). I think pipes and fifo may help but I am unable to figure out how to proceed with them using screen and psql.</p> <p>I appreciate any further hints or workarounds.</p> <p>Thank you,</p> <p>Usman.</p>
    singulars
    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