Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 bash 脚本的初学者。我需要知道如何为输出一个可执行文件创建一个 bash 脚本。 更清楚地说,我有一个可执行文件,它是./word. 此命令的输出不是静态的。所以,我的脚本应该读取这个输出并将其放入脚本中,但是如何呢?
./word
如果./word输出一些您希望运行的 shell 命令(如 ssh-agent 那样),您可以使用eval "$(./word)".
eval "$(./word)"
如果您只想将输出写入文件,请使用./word > file.
./word > file