Running script with HERE_DOC method in background

2019-06-17 11:23发布

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' &)

1条回答
走好不送
2楼-- · 2019-06-17 12:17

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" &
查看更多
登录 后发表回答