Thanks for the reply, the output it's ok, none of the variabbles or values are null, i just want that the format appears like this: 29-12-10/11:43:01,0,250,0,/FIM 0,/mytest 0,/mockofprod/financing/customercentre 0,/mockofprod/financing/commercial/amt 0,/account/orderstatus 0,/activities --- El mié 29-dic-10, m.roth at 5-cent.us <m.roth at 5-cent.us> escribió: De: m.roth at 5-cent.us <m.roth at 5-cent.us> Asunto: Re: [CentOS] Script Output Format A: "CentOS mailing list" <centos at centos.org> Fecha: miércoles, 29 de diciembre de 2010, 11:59 Alejandro Rodriguez Luna wrote: > i'm just did a script that the output must be comma separated to be > imported into a spreadsheet. > > the output that i obteined was > > Date/Time,We. Active Threads,W. Total Threads,W. Worker Threads,Name > 29-12-10/11:43:01,0,250,0,/FIM > ,0,/mytest > ,0,/mockofprod/financing/customercentre > ,0,/mockofprod/financing/commercial/amt > ,0,/account/orderstatus > ,0,/activities > > as you can see, the first row it's ok, but the second and third, etc etc, > are not formated. any ideas of how can i achive this? > > NOTE: the first three values are simple commands that i put in order, the > fourth and fifth are from a file. > > this is part of the code. > > > printf "%s,%d,%d" $DATE $WSAT $WSTT >> output.${STANZA}.txt > > for i in `cat jlist.${STANZA}.txt` > do > JUNCTION=${i} > WSWJ=`pdadmin -a sec_master -p ${PASSWD} server task ${STANZA} show > ${JUNCTION} | grep 'threads' | awk '{ print $4 }'` > printf ",%d,%s\n" ${WSWJ} ${JUNCTION} >> output.${STANZA}.txt > done Well, it looks like $WSWJ is null. What's the output... hmmm, consider that there may be more than one line with "threads", and that the fourth element of the last line may not be what you want. (And you *could* just do ...| awk {if ($0 ~ /threads/) { print $4;}}`) mark _______________________________________________ CentOS mailing list CentOS at centos.org http://lists.centos.org/mailman/listinfo/centos -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20101230/8a4bbc21/attachment-0005.html>