Running script with HERE_DOC method in background

喜夏-厌秋 提交于 2019-12-23 07:51:56

问题


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:


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" &


来源:https://stackoverflow.com/questions/25337304/running-script-with-here-doc-method-in-background

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!