[CentOS] Formatting print with awk and ORS

Joseph L. Casale JCasale at activenetwerx.com
Tue Jul 7 15:57:11 UTC 2009


>awk -v q="'" ' BEGIN { ORS=" "; printf("%s", q) } { print "\"" $1 "\"" } END { printf("%s", q) } '
>or
>awk ' BEGIN { ORS=" "; printf("\x27") } { print "\"" $1 "\"" } END { printf("\x27") } '

Thanks JD!



More information about the CentOS mailing list