Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Create a bash shell script to sort and then
uniq the file from the command line & store it to a new
file and output the results to the screen. Name this
script "sortAndUniq.sh"

Answers were Sorted based on User's Feedback



Create a bash shell script to sort and then uniq the file from the command line & store it to ..

Answer / vipul dalwala

sort $1 | uniq | tee output.txt

Is This Answer Correct ?    5 Yes 0 No

Create a bash shell script to sort and then uniq the file from the command line & store it to ..

Answer / vipul dalwala

$1 is the filename u are passing from commnadline

i.e. sh sortAndUniq.sh filename.txt

So $1 = filename.txt

All the commnadline parameters passed to the script are get
stored in $1 , $2, $3....

For example : sh sortAndUniq.sh filename1.txt filename2.txt
filename3.txt

Then $1 = filename1.txt , $2 = filename2.txt , $3 =
filename3.txt

Is This Answer Correct ?    5 Yes 0 No

Create a bash shell script to sort and then uniq the file from the command line & store it to ..

Answer / roopa

hey can you please tell me what is the avlue of $1
and how do we specify that in our script?

Is This Answer Correct ?    1 Yes 0 No

Create a bash shell script to sort and then uniq the file from the command line & store it to ..

Answer / supriya

sort -u filename1 |tee file2

Is This Answer Correct ?    0 Yes 0 No

Create a bash shell script to sort and then uniq the file from the command line & store it to ..

Answer / linuxdemon

sort $1 | uniq > output | echo "`cat output`"

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More Shell Script Interview Questions

Tell something about the super block in shell scripting?

0 Answers  


what is the meaning of First line of shell script ,what is meaning of #! pleas explain brifly

4 Answers  


What is the default ubuntu terminal?

0 Answers  


how to read systems current date and time

4 Answers  


What is the use of "shift" command in passing parameters?

1 Answers  


How to customise the existing shell?

1 Answers  


How to customise the other shell?

2 Answers   Quest,


What is the meaning of $1 in shell script?

0 Answers  


write a shell program to check wheather a given string is pallindrome or not?

4 Answers  


How do I start a shell script?

0 Answers  


what are special characters and explain how does text varies by the usage of single quotes,double quotes and back quotes?

1 Answers  


Why we are writting shell scripts? Plz if possible explain it briefly.

6 Answers   ITC Infotech,


Categories