I am wondering if there is any meaningful difference between the results of running these two commands, one using piping and the other redirection. I got the exact same output in the terminal when running them, but the former was not accepted by the lesson, while the latter was:
cat name.txt | ./script.sh
./script.sh < name.txt
The first should read the contents of name.txt as stdout and pipe it as stdin into my script. The second redirects the contents of name.txt as the stdin of my script? Are those statements correct? Is the first one basically just the long way because there’s an extra step?
I was working on this step: It didn’t ask for input and nothing was printed in the terminal that time. You redirected both outputs to files. You should take a look at them to see if they have what you expected. Run your script again, use redirection to set name.txt
as the input. Don’t redirect any of the output.
Lesson: