Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running script with HERE_DOC method in background

I have a script that should be run in background. I must answer a question as soon as I run the bash..How can I do that?

(nohup python script.py lst '<<HERE yes HERE' &)
like image 308
MLSC Avatar asked Aug 16 '14 05:08

MLSC


1 Answers

The << heredoc is multiline, like

somescript <<EOF &
input
EOF

the heredoc delimiter should be alone on the final line

You can use one line heredoc with <<<, like:

somescript <<<"this coming from stdin" &
like image 97
jm666 Avatar answered Sep 28 '22 02:09

jm666