By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,571 Members | 972 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,571 IT Pros & Developers. It's quick & easy.

question about about Bourne Shell programming

P: 9
I would like to know what does the code below do

#!/cs/local/bin/sh
(cat $1; cat $2) | sort -r | uniq -d | cut -f1,4

can anybody explain it to me
Apr 1 '08 #1
Share this Question
Share on Google+
2 Replies

kaarthikeyapreyan
100+
P: 107
I would like to know what does the code below do

#!/cs/local/bin/sh
(cat $1; cat $2) | sort -r | uniq -d | cut -f1,4

can anybody explain it to me
This code gets two file names from the command prompt
if the contents in your file $1(first arg) and $2(second arg) contains numerals or alphabets or alphanumerals they would be sorted in a reverse order listing all the lines without repetition and cut the fields 1-4 from the output(perhaps all the lines would be printed cause no delimiter is specified)
Apr 1 '08 #2

gpraghuram
Expert 100+
P: 1,275
I would like to know what does the code below do

#!/cs/local/bin/sh
(cat $1; cat $2) | sort -r | uniq -d | cut -f1,4

can anybody explain it to me

Whenever i encounter a command like this, i would break it into different commands and then see what every command does.



Raghuram
Apr 2 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.