我想运行一个可以在除我自己的终端之外的其他终端中访问的脚本。像 bash <(curl -s http://domain.com/scripts/hello.sh ) 但我需要这个脚本来 grep 一个也位于该服务器上的 txt 文件,例如domain.com/scripts/stuff.txt。最好的方法是什么?
最佳答案
下载文本文件,并将其输入 grep:
curl http://domain.com/scripts/stuff.txt | grep foo
关于linux - 如何在bash脚本中grep外部txt文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22083644/