Solved

sort command HPUX

Posted on 2011-03-10
11
65 Views
Last Modified: 2016-05-30
The sort command looks to be different on HP than Solaris. Can someone tell me the sort command for following records, sorted in ascending order by the date field (4th column below)

Thanks

dd690SYSFULL.001.RO 2773916126 1297521166 02/12/11
dd690SYSFULL.001.RO 90166349 1298125950 02/19/11
dd690SYSFULL.001.RO 1751716709 1298731929 02/26/11
dd690SYSFULL.001.RO 225595826 1299337703 03/05/11
dd690SYSFULL.001.RO 3007587449 1296311459 01/29/11
dd690SYSFULL.001.RO 642604794 1296916263 02/05/11
dd690SYSFULL.001.RO 3780548990 1297521070 02/12/11
dd690SYSFULL.001.RO 727700530 1298125923 02/19/11
dd690SYSFULL.001.RO 3999862400 1298730676 02/26/11
dd690SYSFULL.001.RO 1098008824 1299335470 03/05/11
0
Comment
Question by:sonriks
11 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 35095636
Does this work?

sort -t" " -n -k 4.7,4.8 -k 4.1,4.2 -k 4.4,4.5 inputfile

?

wmp
0
 
LVL 1

Author Comment

by:sonriks
ID: 35098410
no, didn't work
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 35098495
Why?
Error messages?
Wrong output?

Please remember that it's your problem, not ours!
0
 
LVL 1

Author Comment

by:sonriks
ID: 35098763
the column was not sorted correctly.
Comments like yours I can do without.
Please do not attempt to help with this issue.
I will find the answer elsewhere.
0
 
LVL 48

Expert Comment

by:Tintin
ID: 35098914
What output are you getting and what sort command are you using on the Solaris system that works with the same data?
0
Scale it in WD Gold

With up to ten times the workload capacity of desktop drives, WD Gold hard drives employ advanced technology to deliver among the best in reliability, capacity, power efficiency and performance.

 
LVL 3

Expert Comment

by:Alberto Cortes
ID: 35112500
Solution:

      sort -k 4,4 inputfile
0
 
LVL 7

Expert Comment

by:jackiechen858
ID: 35116486
That's not very nice towards some people trying to help you.   I  tried woolmikproc 's command on a HPUX  11 and it actually is working fine.

example file:
dd690SYSFULL.001.RO 90166349 1298125950 02/19/11
dd690SYSFULL.001.RO 2773916126 1297521166 12/12/10
dd690SYSFULL.001.RO 1751716709 1298731929 02/26/11
dd690SYSFULL.001.RO 3007587449 1296311459 09/29/07
dd690SYSFULL.001.RO 225595826 1299337703 09/05/07
dd690SYSFULL.001.RO 642604794 1296916263 02/05/11
dd690SYSFULL.001.RO 3780548990 1297521070 02/12/11
dd690SYSFULL.001.RO 727700530 1298125923 02/19/11
dd690SYSFULL.001.RO 3999862400 1298730676 02/26/11
dd690SYSFULL.001.RO 1098008824 1299335470 03/05/11
dd690SYSFULL.001.RO 1098008824 1299335470 11/11/09

result:
 sort -t" " -n -k 4.7,4.8 -k 4.1,4.2 -k 4.4,4.5 1
dd690SYSFULL.001.RO 225595826 1299337703 09/05/07
dd690SYSFULL.001.RO 3007587449 1296311459 09/29/07
dd690SYSFULL.001.RO 1098008824 1299335470 11/11/09
dd690SYSFULL.001.RO 2773916126 1297521166 12/12/10
dd690SYSFULL.001.RO 642604794 1296916263 02/05/11
dd690SYSFULL.001.RO 3780548990 1297521070 02/12/11
dd690SYSFULL.001.RO 727700530 1298125923 02/19/11
dd690SYSFULL.001.RO 90166349 1298125950 02/19/11
dd690SYSFULL.001.RO 1751716709 1298731929 02/26/11
dd690SYSFULL.001.RO 3999862400 1298730676 02/26/11
dd690SYSFULL.001.RO 1098008824 1299335470 03/05/11




0
 
LVL 1

Author Comment

by:sonriks
ID: 35142530
Thanks to you all. I'll try the above command again. I am impressed by the level of knowledge of folks who use this site, and appreciate the help!
0
 

Expert Comment

by:EE_AutoDeleter
ID: 41623823
I've requested that this question be deleted for the following reason:

                           
No comment has been added to this question in more than 21 days, so it is now classified as abandoned and is now flagged for deletion.


If there is a valid solution, please OBJECT and indicate the comments that are, or would otherwise lead to, a solution.


Use the specific format https:#axxxxxxxx for comment ID(s).


Also, please don't object simply because the author did not respond to your comment. While we understand this is frustrating, unfortunately we cannot force the author to return to the question. Unless you feel you have presented a valid, verifiable solution we'll simply delete the question.


Experts-Exchange Auto Deleter
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 41623824
As confirmed by jackiechen858 (https:#a35116486) the solution in
https:#a35095636
is correct and valid.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Replication has always been one of those technologies that people run scared from. The main reason is usually cost. When you think of replication, your mind drifts to solutions that replicate from one disk frame to another using block level technolo…
Are you looking to recover an email message or a contact you just deleted mistakenly? Or you are searching for a contact that you erased from your MS Outlook ‘Contacts’ folder and now realized that it was important.
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now