Here is an example of Bash's process substitution:
zjhui@ubuntu:~/Desktop$ echo >(ls)
/dev/fd/63
zjhui@ubuntu:~/Desktop$ abs-guide.pdf
Then I get a cursor waiting for a command.
/dev/fd/63 doesn't exist. I think what happens is:
- Output the filename used in
/dev/fd - Execute the
lsin>(ls)
Is this right? Why is there a cursor waiting for input?
When you execute
echo >(ls), bash replaces this withecho /dev/fd/63and runslswith/dev/fd/63connected to its standard input.echodoes not use its arguments as file names, andlsdoes not use standard input. Bash will write your standard prompt but the output oflscomes after it. You can type in any Bash command there, you just lost the visual cue from the prompt, which is further up the screen.echo >(ls)is not something that is likely to ever be useful.