Solved

sort command HPUX

Posted on 2011-03-10
11
107 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
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
 
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

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.
The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…

622 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