开发者

BASH script passing stdin input to a program and giving control back to user input

开发者 https://www.devze.com 2022-12-08 01:16 出处:网络
(I looked everywhere for this, perhaps my googling skill is off today) I have a program that requires a handful of initialization cmds from stdin (and not through arguments). It\'d be nice to move th

(I looked everywhere for this, perhaps my googling skill is off today)

I have a program that requires a handful of initialization cmds from stdin (and not through arguments). It'd be nice to move those commands into a script so when the script completes I can start keying the real work. So something like:

cat initcmds.txt | myprogram.exe

the problem is that the program (child process) terminates after receiving EOF at th开发者_如何转开发e end of initcmds.txt. How do you do this? (Bash, Korn, cmd.exe, csh, all good)


cat initcmds.txt - | myprogram.exe

0

精彩评论

暂无评论...
验证码 换一张
取 消