开发者

Why doesn't the pipe command work for me?

开发者 https://www.devze.com 2023-01-28 07:08 出处:网络
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.

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

精彩评论

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