echo $PATH | tr ":" "\n" > path.txt while read line do ls -a $line >> programs.txt done < path.txt sort programs.txt
Standard input is empty
Standard output is empty
./prog.sh: line 1: path.txt: Permission denied ./prog.sh: line 1: echo: write error: Broken pipe ./prog.sh: line 5: path.txt: No such file or directory sort: cannot read: programs.txt: No such file or directory