The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > HP-UX
Google UNIX.COM


HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Sorting problem cool4naren UNIX for Dummies Questions & Answers 4 07-31-2007 05:28 AM
sorting/arrangement problem Abhishek Ghose Shell Programming and Scripting 7 05-25-2007 06:19 AM
Sorting/Filed Defining/Output problem TiredOrangeCat Shell Programming and Scripting 1 02-11-2007 09:41 PM
Sorting problem "sort -k 16,29 sample.txt > output.txt" ganapati Shell Programming and Scripting 3 08-01-2006 02:55 AM
Problem in sorting the file vishnu_vaka Shell Programming and Scripting 1 12-04-2005 08:47 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-21-2007
Registered User
 

Join Date: Jun 2007
Posts: 4
Sorting problem....

hey mate. ive got a sorting problem that i would like to share...

i made a script that sorts the bdf command and redirected the output to a file. the output of the file is:

691416 34% /
851552 7% /stand
7203048 31% /var
23637584 26% /var/adm/crash
2968864 37% /usr
1744096 16% /tmp
2381048 54% /opt
514848 51% /home
17% /home/com
986359 81% /home/appl
36% /backup_master
91% /backup

8227336 17% /home/com
2593361 36% /backup_master
5903593 91% /backup



please tell me how to sort out the file so that i can remove the ones in
bold (blue) because they are just copies of the file systems in bold (black).
please help me...
Reply With Quote
Forum Sponsor
  #2  
Old 06-24-2007
becket's Avatar
Registered User
 

Join Date: Jul 2005
Location: Liege / Belgium
Posts: 36
i don't think you really need to sort

Code:
cat file.txt  |sed -n '/[0-9]* [0-9]*%/p'
Reply With Quote
  #3  
Old 06-24-2007
Registered User
 

Join Date: Jun 2007
Posts: 4
thanks mate. it works.... do you know how to further sort the output so that only the ones with 80% up are shown

Last edited by jarod004; 06-24-2007 at 03:37 PM.
Reply With Quote
  #4  
Old 06-24-2007
Registered User
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,397
Quote:
Originally Posted by jarod004 View Post
thanks mate. it works.... do you know how to further sort the output so that only the ones with 80% up are shown
Code:
$ cat file
691416 34% /
851552 7% /stand
7203048 31% /var
23637584 26% /var/adm/crash
2968864 37% /usr
1744096 16% /tmp
2381048 54% /opt
514848 51% /home
17% /home/com
986359 81% /home/appl
36% /backup_master
91% /backup
8227336 17% /home/com
2593361 36% /backup_master
5903593 91% /backup
$ awk -F"[ %]" ' $2 > 80 ' file
986359 81% /home/appl
5903593 91% /backup
Reply With Quote
  #5  
Old 06-24-2007
Registered User
 

Join Date: Jun 2007
Posts: 4
thanks mate. i also found a nifty syntax that does the same... still, thanks...


cat file|grep [8-9][0-9]%
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 04:47 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0