Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Sort and count in bourne shell
Name: pnxi Date: September 7, 2003 at 20:29:45 Pacific OS: Unix CPU/Ram: Intel
Comment:
Hi, I am a newer in Bourne shell. I have a log file which contain many lines(information about file used), now I want to count the 10 most requested files in the log, and display the 10 in descending order. I don't know how to count the duplicate files and sort them in descending order, any command for that purpose? can anybody tell me how to accomplish that?
Name: David Perry Date: September 8, 2003 at 04:25:13 Pacific
Reply:
If you are talking about monitoring web traffic, there are plenty of log analyzing tools already.
sort -u will give you unique results although you would want to only look at the portion of each log entry to would give you a unique result, ie exclude the date/time stamp and who asked for the file. awk will help you look at portions of a line. grep -c will give you a count of occurances. sort -n -r will sort numerically in decending order.
Summary: Hi, in Cshell we can use goto statement, How can we use this in bourn shell? If any body can help me with the syntax with example it will be great. Thanks in advance.. Swapan satpathi ...
Summary: I need to check and see in a bourne shell script if a file that I want to process is open currently and being written to by another process. Any help appreciated ...