The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > AIX
Google UNIX.COM


AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Printing all combinations : Awk jkl_jkl Shell Programming and Scripting 7 05-28-2008 09:17 AM
All Shortcut key combinations --crimson-- UNIX for Advanced & Expert Users 0 07-10-2006 12:20 AM
Combinations Khoomfire UNIX for Advanced & Expert Users 4 06-06-2006 03:32 AM
Awk execution with more combinations.. mitte_dino Shell Programming and Scripting 1 09-28-2005 10:53 AM
Need Help with Awd/sort commands flarebel UNIX for Dummies Questions & Answers 5 12-06-2003 04:12 PM

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

Join Date: Dec 2007
Posts: 15
How to use cat and sort commands combinations?

Hi,
I need to get five names as input and sort it. It has to be done in the command level only. It should not read from any files.

I tried with many combinations. I didnt get it.

I can able to get the input using

cat > sample
jik
njvi
abifj

...like this and i dont know how to sort it here.

Many Thanks.
Reply With Quote
Forum Sponsor
  #2  
Old 12-18-2007
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,610
once file <sample> is ready

use the command sort

Is that what you are looking for ?
Reply With Quote
  #3  
Old 12-18-2007
Registered User
 

Join Date: Oct 2007
Location: USA
Posts: 568
Quote:
Originally Posted by Yamini Thoppen View Post
Hi,
I need to get five names as input and sort it. It has to be done in the command level only. It should not read from any files.

I tried with many combinations. I didnt get it.

I can able to get the input using

cat > sample
jik
njvi
abifj

...like this and i dont know how to sort it here.

Many Thanks.

How do you want to sort them...alphabetically or its inverse?

Code:
cat <<EOF | sort -k1,1
jik
njvi
abifj
yada_yada
blah_blah
EOF
Reply With Quote
  #4  
Old 12-19-2007
Registered User
 

Join Date: Dec 2007
Posts: 15
Thanks.Exactly i want this only.

Quote:
Originally Posted by shamrock View Post
How do you want to sort them...alphabetically or its inverse?

Code:
cat <<EOF | sort -k1,1
jik
njvi
abifj
yada_yada
blah_blah
EOF
Hi Shamrock,

Exactly i want this only..Many Thanks to you
Reply With Quote
  #5  
Old 12-19-2007
Registered User
 

Join Date: Dec 2007
Posts: 15
Thanks

Quote:
Originally Posted by matrixmadhan View Post
once file <sample> is ready

use the command sort

Is that what you are looking for ?
Hi Madhan,

I have gonethrough your reply. But i want exactly the Shamrock codings which he is given.

cat <<EOF | sort -k1,1
jik
njvi
abifj
yada_yada
blah_blah
EOF
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 06:28 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