21sh
21sh copied to clipboard
Pipe redirection
Input is broken for next commands if tou type cat | ls
or sort | ls
Because cat and sort waits input from stdin, when ls ends, your shell waits for next command but cat / sort keeps reading stdin, so half of user input goes into those processes.
Bash will print ls result, wait cat / sort to end and will then wait for next command. Note that ctrl-c signal stop your cat / sort process and fix the issue until next broken command