I have a file with no eof, and I want to change it, I know I can do awk 1 file > file2, but I would like to know what awk 1 means?
thanks
I have a file with no eof, and I want to change it, I know I can do awk 1 file > file2, but I would like to know what awk 1 means?
thanks
In Unix, there is no such thing as EOF. Do you mean it is missing a final newline?
1 is a pattern that is always true. In the absence of an action ( {...} ), awk prints the line.
awk evaluates the 1 as true and the prints the entire line by default, including a newline.
Regards
thanks