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.
我想做这样的事情:
$ ( foo1.sh $1 | foo2.sh | bar.sh |) arg
有时管道比写函数快,但我现在可以parameters/args在管道之间传递 :我是三合会搜索包firefox,xbps但我得到以下错误:
parameters/args
firefox
xbps
$ xbps-query -Rs $1 | fzf firefox xbps-query: option requires an argument -- 's' unknown option: firefox
管道没有参数。相反,编写一个带有参数并运行所需管道的脚本或函数:
foo() { xbps-query -Rs "$1" | fzf }
然后你可以运行它foo firefox
foo firefox