Supressing new-lines in awk output

Steinar Overbeck Cook steinar at fdmetd.uucp
Fri Feb 10 03:10:06 AEST 1989


In article <21638 at conexch.UUCP>, root at conexch.UUCP (Larry Dighera) writes:
> Is there a way to supress the newline at the end of awk's print output?
> 
> Given:
> 
> 	awk '{print $1}' filename
> 

Use this instead:

	awk '{ printf("%s", $1) }'


-- 
Steinar Overbeck Cook, Fellesdata a.s, P.O. Box 248, 0212 OSLO 2, NORWAY
Phone : +47 2 52 80 80                            Fax   : +47 2 52 85 10
E-mail : ...!mcvax!ndosl!fdmetd!steinar  or       steinar at fdmetd.uucp
<The opinions expressed, if any, do not represent Fellesdata a.s>



More information about the Comp.unix.questions mailing list