How would I get awk to output the whole file name in ls -l if some of the files have spaces in them. Usually, I can run this command:
There's probably a better approach that involves combining fields somehow, but:
$ echo 1 2 3 4 5 6 7 8 9 10 11 12 13 14... |
awk '{for (i = 9 ; i <= NF ; i++) printf "%s ", $i}'
9 10 11 12 13 14...
Using printf "%s " $i will print the i-th field with a space after it, instead of a newline. The for loop just says to go from field 9 to the last field.