The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Operating Systems > 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 09:28 AM
sorting/arrangement problem Abhishek Ghose Shell Programming and Scripting 7 05-25-2007 10:19 AM
Sorting/Filed Defining/Output problem TiredOrangeCat Shell Programming and Scripting 1 02-12-2007 12:41 AM
Sorting problem "sort -k 16,29 sample.txt > output.txt" ganapati Shell Programming and Scripting 3 08-01-2006 06:55 AM
Problem in sorting the file vishnu_vaka Shell Programming and Scripting 1 12-04-2005 11:47 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-21-2007
jarod004 jarod004 is offline
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...
  #2 (permalink)  
Old 06-24-2007
becket's Avatar
becket becket is offline
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'
  #3 (permalink)  
Old 06-24-2007
jarod004 jarod004 is offline
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 07:37 PM..
  #4 (permalink)  
Old 06-25-2007
anbu23 anbu23 is offline Forum Advisor  
Registered User
  
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,398
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
  #5 (permalink)  
Old 06-25-2007
jarod004 jarod004 is offline
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]%
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:11 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0