[SunHELP] reformating output

Adrian.Florea at alcatel.ro Adrian.Florea at alcatel.ro
Fri Aug 16 03:20:40 CDT 2002


Hi,

as an example try this:

cat /etc/passwd | awk 'BEGIN{ FS=":"; $result="" } { $result=($result" "$1)} END{ print $result}'

, I tested it on /etc/passwd and it outputs something that you may like.

In this example fileds are separated by : in the file.

Best regards,
Adrian Florea.

On Thu, 15 Aug 2002, Markham, Richard wrote:

> I am working with a file "users" that contains usernames,
> 1 entry per line.  I am trying to cat that into awk and
> make the output display it in the form:
>
> 'BOB','JANE','FRED','JOE'...........
>
> I am having trouble with the awk print command for one
> I dont know that I can strip the carriage return and when
> I try printf I must be getting the format incorrect when
> using the ' and ,
> Can anyone suggest?
> _______________________________________________
> SunHELP maillist  -  SunHELP at sunhelp.org
> http://www.sunhelp.org/mailman/listinfo/sunhelp



More information about the SunHELP mailing list