3 ms·
{ print $0 }, { print }, and nothing (i.e. no action given - but a pattern is given) are all equivalent, and result in printing the current line of the input (i
by vram22 8y ago
{ print $0 }, { print }, and nothing (i.e. no action given - but a pattern is given) are all equivalent, and result in printing the current line of the input (if it matches the pattern). Similarly, if no pattern is given, but an action is given, the default is to match every line (and so perform the given action on every line). Either the pattern or the action must be given, or both.