I'm using Solaris 10, and need help in sorting the below output from the syslog file in descending rather than ascending order.
I would like both the hostname and message columns to be sorted, but right now only the message is sorted and the count column, whose order I would like reversed. I need the count column to be sorted listing the highest count at the top.
Command:
Output:
Regards, Wynford
Last edited by Scott; 10-03-2010 at 10:35 AM..
Reason: Please use code tags
Think that should be close to what you're after ??
---------- Post updated at 10:36 AM ---------- Previous update was at 10:27 AM ----------
Quote:
Originally Posted by Tytalus
try changing:
to
Think that should be close to what you're after ??
Hi Tytalus, et al
I actually need my output to be like the following, so that the count is in descending order listing all hosts for each message type: (I have removed the appending domain name for privacy)
I have a file which contains following lines:
0114714710147 09013 00025.00D986532147
2814714710147 09013 00045.00D985532147
Now, I need to sort the file with above bold and colured one. Means:
first sorting will be done by: 147147 then by 10147 09013 after that by 986532147.
The... (2 Replies)
Hi ,
i have a belwo script which is used to get sectors per track value extarcted from Solaris machine:
for DISK in /dev/dsk/c*t*d*s*; do value=`prtvtoc "$DISK" | sed -n -e '/Dimensions/,/Flags/{/Dimensions/d; /Flags/d; p; }' | sed -n -e '/sectors\/track/p'`; if ; then echo... (4 Replies)
I need help to sort the output of an awk array
Example datadata="1 blue
2 green
3 blue
4 yellow
5 blue
6 red
7 yellow
8 red
9 yellow
10 yellow
11 green
12 orange
13 black"
My awk line to get output in one lineecho "$data" | awk ' {arr++; next} END { for (i in arr) { if(arr>1 )... (2 Replies)
can someone please tell me who to sort the numerical output of echo?
UIO="8180 0 0 0 0 0 0 0 0 0 0 48240 48240 48240 48240 48240 48240 0 0 0 0 0 0 0 48300 0 0 0 48300"
echo $UIO | sort -n
This doesn't workk. it does not sort the numbers from smallest to highest. any ideas? (2 Replies)
Hi all,
I have a script which produces a nice table but I want to sort it on column 3.
This is the output line in the script:
# Output
{ FS = ":";
format = "%11s %6s %-16s\n";
prinft "\n"
printf ( format, "Size","Count","Who" ) }
for (i in... (21 Replies)
Hello all,
I've been woking on Solaris and Linux (Red Hat) so far but now I've inherited an HP-UX system and having minor issues with syntax...Appreciate if you could help me out here..
1) I'm trying to sort the output of the top command in HP-UX 11.11 by pressing O (capital O) after typing... (2 Replies)
Hi all,
I need your help in sorting some columns in a syslog report.
The command is:
for messages in `cat syslog_message_list.txt`; do grep $messages syslog.`date +%d%m%y`.log | \
tr -s " " | cut -d" " -f4,9- | sort| uniq -c >> syslog.`date +%d%m%y`.report; done
The output is:
1... (4 Replies)
Hi, Please I need urgent help in sorting below data, I had similar post but there was a kind of space in between the data but now there is no space and I have tried adjusting the old script to work but it didn't.
here are the data;
traceroute to 2001:1ba0:2a0:5965:0:30:24:1... (6 Replies)
Hi guys,
I have a service directory with a lot of files in.
I have to cksum the whole directory and compare it to a release note document.
However the problem I have is the files are listed in different lines when running cksum as they are in the release doc. Therefore cksum shows... (1 Reply)
hi,
I get an output like
uid=user1
gecos=user
uid=user2
gecos=admin
gecos=sol admin
uid=user3
uid=user4
gecos=sol, admin
and need it modified to:
uid=user1
gecos=user (3 Replies)