Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Output manipulation ?

Status
Not open for further replies.

Sudmill

Programmer
Apr 20, 2001
65
GB
Hi,

Ive creating the following script to log the level of paging space to a file. But I wondered if there was a more elegant way to achieve this because it looks fairly clumsy to me (and Ive not really used nawk b4)!?

date +"%m%d%H%M%t" > ./ps.tmp
lsps -s | tail -1 | nawk '{print $NF}' >> ./ps.tmp
cat ./ps.tmp|nawk '{ printf("%s%s", $0, (NR % 2) ? " " : "\n")}' >> ./ps.log

BTW, please let me know if anyone finds this script useful!


Cheers

John (Sudmill)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top