Solved

sort command HPUX

Posted on 2011-03-10
11
53 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
Comment Utility
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
Comment Utility
no, didn't work
0
 
LVL 68

Expert Comment

by:woolmilkporc
Comment Utility
Why?
Error messages?
Wrong output?

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

Author Comment

by:sonriks
Comment Utility
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
Comment Utility
What output are you getting and what sort command are you using on the Solaris system that works with the same data?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 3

Expert Comment

by:Alberto Cortes
Comment Utility
Solution:

      sort -k 4,4 inputfile
0
 
LVL 7

Expert Comment

by:jackiechen858
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
As confirmed by jackiechen858 (https:#a35116486) the solution in
https:#a35095636
is correct and valid.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…
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…

743 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

17 Experts available now in Live!

Get 1:1 Help Now