So, I learn about pipes in bash, and I found this detailed description:
The Unix channel connects the file descriptor STDOUT (standard output) the first process to STDIN (standard input) the second. What happens when the first process writes to STDOUT that the output can be immediately read (from STDIN) by the second process.
Source
Given this understanding, connect STDOUT printfto STDIN ls. For simplicity, type the parent directory ( printf ..).
~/Desktop/pipes$ mkdir sub
~/Desktop/pipes$ ls
sub
~/Desktop/pipes$ cd sub
(no files)
~/Desktop/pipes/sub$ printf .. | ls
(no files)
~/Desktop/pipes/sub$
I want to do: ls ..but it seems that all I get is that ls. Why is this so? How can I lsuse the parent directory pipes? Am I misunderstanding the pipes?