Solved

sort command HPUX

Posted on 2011-03-10
11
74 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
A Bare Metal Image backup allows for the restore of an entire system to a similar or dissimilar hardware. They are highly useful for migrations and disaster recovery. Bare Metal Image backups support Full and Incremental backups. Differential backup…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…

816 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

12 Experts available now in Live!

Get 1:1 Help Now