Slide 57 of 80
Notes:
- Script as written works fine interactively!
- Works correctly if a line in DATAFILE is empty (but it must be variable width file)
- Otherwise, if datafile is fixed ASCII, you will see the “Enter name” prompt 20 times (no crlf) and get eof error on INPUT, as shown in the slide.
- The next slide shows how to modify this script to work correctly when $STDIN is redirected and still function as expected when invoked interactively.