开发者

Why doesn't the pipe command work for me?

Actually in my last question I was trying to use the pipe command. I am looking at an example in Process Substitution - Advanced Bash-Scripting Guide.

I tried these lines:

 bzip2 -c < pipe > file.tar.bz2 & 
 tar cf pipe $directory_name 
 rm pipe

But they are failing with an error:

pipe: No such file or directory. 

W开发者_Python百科hat's happening here? Is this an error in the ABS guide?


The example you're using appears to assume that the named pipe called "pipe" already exists in the current directory. The "pipe" in here:

bzip2 -c < pipe > file.tar.bz2 &

is not a command name, it is a file name that happens to be a named pipe. Do some reading on "mkfifo" and "named pipes" for more information.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜