- Make sure you are in the ex12 directory
pwd
- Copy the program repeat.sh from my course_files/it244_files
directory to your ex12 directory
cp ~ghoffman/course_files/it244_files/repeat.sh .
- Copy the text file five_lines.txt from the course_files/it244_files
directory to your ex12 directory
cp ~ghoffman/course_files/it244_files/five_lines.txt .
- Make sure the copy operation worked
ls
- Run the program repeat.sh
./repeat.sh
Enter 5 lines of text when prompted by the script.
This program simply prints whatever input it receives to standard output.
- Look at the contents of five_lines.txt
cat five_lines.txt
- Run the same program taking input from a file
./repeat.sh < five_lines.txt
repeat.sh took its input from the file five_lines.txt
and printed each line on the screen.