Ankur Agarwal
Ankur Agarwal

Reputation: 24758

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. 

What's happening here? Is this an error in the ABS guide?

Upvotes: 0

Views: 381

Answers (1)

mu is too short
mu is too short

Reputation: 434665

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.

Upvotes: 2

Related Questions