Hi Guys

I have created a script and everything works but i want my script to sort by the highest count etc.

The script counts the amount of times a job fails , for example the output looks like this:

u08.joebloggs.ndm has failed 1 times
u09joeblogs.rpt has failed 5 times
u10.joeblogs.fw has failed 1 times

How can i get the script to sorted it but the highest amount of times failed.

do i have to use nawk some how, nawk print $ 4 then sort maybe???

Any ideas would be great

scriptname.sh | sort +3nr

Hi

The data is emailed to me so its all held here

cat $HOME/scripts/autoinfo1.txt | mailx -s "job failure" joeblogg@hotmail.com

that sort command doesnt work against the script, or if i pipe after i cat the file.

cat $HOME/scripts/autoinfo1.txt | sort +3nr | mailx -s "job failure" joeblogg@hotmail.com

excellent it work, thanks alot

so what does the sort +3nr mean??

got it skip the first 3 fields then sort numerically reverse order, cheers

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.