To be more specific, the default action for any
true statement is to print the line. Since any number other than zero evaluates as being true, using "
1" as a command acts as a quick shortcut for typing "
print".
By the way, the command as given above doesn't just double-space the file. the "blank" lines actually have one space in them. You probably want to tell it to print nothing instead.
Code:
awk '1;{print ""}' file.txt
And for
yet another way to write it:
Code:
awk '{print $0"\n"}' file.txt
Edit: Speaking of which, you might be interested in this:
http://www.catonmat.net/blog/awk-one...ined-part-one/