Using "sort" in Solaris 8 to process text
2007-12-24 20:49:00
>
> I have what appears to be a simple task; yet I have not been able to
> figure it out ... I have a kornshell script which is processing some
> basic text using the "sort" command. The script works fine on
> "pre-Solaris 8" systems; however, now that I am trying it on a Solaris 8
> system it seems to be broken. As a result I believe that the sort command
> has changed with Solaris 8, and therefore the answer should be checked on
> a Solaris 8 box ...
>
> Mon_Sep_17_15:03 600 Perf_Data_Below_Limits
> Mon_Sep_17_15:03 590 c1t9d0s3
> Mon_Sep_17_15:03 590 Perf_Data_Below_Limits
> Mon_Sep_17_15:03 580 Perf_Data_Below_Limits
>
> * Field # 1 and # 2 might be the same so it must key off of field # 3 such
> that it keeps the first line only ( the one with "c..." NOT "P..." )
>
> You will notice that there are 2 entries with "590". When this occurs, I
> need to have the second occurrence deleted ( I only want the one with the
> "c1t9d0s3" ). Before this was possible by using the following command
> "sort +1rn -u -k 2,2", which said to use the second field ( and only the
> second field ) as the key for sorting the data ( -k 2,2 ) and then make it
> unique ( -u ). Unfortunately, this does not work anymore on a Solaris 8
> machine. I am not sure if it is a bug or if it is my limited knowledge of
> how to make the "sort" command do what I want, but I sure could use some
> help ... Please let me know if you have any ideas about how to process
> the text above to delete the 2nd line containing "590".
>
> TIA,
>
> *** VERITAS Vision 2001 is Sun Nov 4 - Thurs Nov 8 in Dallas ***
> *** Find out more, or register at www.veritasvision.com ***
>
> John Hilger
> Enterprise Systems Engineer
>
> Desk Phone : (972) 361-8624
> E-mail : John.Hilger at Veritas.com
>
> Veritas Software Corporation
> 15950 N. Dallas Pkwy, Suite 800
> Dallas, TX 75248
>
>
Comments
Got something to say?
You must be logged in to post a comment.

