有没有办法在bash中有效地做到这一点:
/my/bash/script < echo 'This string will be sent to stdin.'
Run Code Online (Sandbox Code Playgroud)
我知道我可以管道回声的输出,如下所示:
echo 'This string will be piped to stdin.' | /my/bash/script
Run Code Online (Sandbox Code Playgroud) 我无法区分这两行代码,因为每个命令的输出是相同的
cat volcanoes.txt
Run Code Online (Sandbox Code Playgroud)
cat < volcanoes.txt
Run Code Online (Sandbox Code Playgroud)