Quote:
Originally Posted by
hanson44
Yes, alister is right. "read" is very different from "break" and "continue".
Also, awk is very different from shell. One huge difference is that awk is not intended as an interactive environment.
There is no reason why awk can't be used interactively. If you don't specify any input file for your awk program, it will read from standard input. If you need your awk program to read initialization data from a file and then interact with a user by reading standard input after that, use the name of the initialization data file as the first file operand and - as the next file operand.
When I'm testing small awk programs to see why some expression isn't working the way I expected, I frequently type in a small awk program and then just type input into it see what happens (and end it with ctl-D).
It is true that the shell and awk languages are different, but awk certainly has multiple ways to read and write files. Look at the awk man page on your system and search for the descriptions of functions like close, getline, print, printf, and system.
And as several people have said, break and continue have nothing to do with reading a file; they are used inside while and for loops for flow control in those loops.