AWK – print no newline

awk2Using awk to display information, the print function, by default, adds newline after each iteration. I wanted to copy the results and use them as an actual array in a program and preferred to have them all on one line, however. So printf had to be used instead of print:

The result would be:

which I could copy and use as an actual value of an array somewhere else.

Tagged with: , ,