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"

Answer Posted / linuxdemon

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

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to find all the files modified in less than 3 days and save the record in a text file?

843


What is the best scripting language?

781


Give some situations where typing error can destroy a program?

940


How do I run a powershell script?

795


How do you create a shortcut in linux?

806


What does chmod do?

765


Is shell scripting a programming language?

807


Which is better perl or shell scripting?

768


write a shell script to generate a alert ? like when ur birthday came then generate a alert ur birthday is today like that ?

3811


How do I edit a .sh file?

865


In my bash shell I want my prompt to be of format '$"present working directory":"hostname"> and load a file containing a list of user-defined functions as soon as I log in, how will you automate this?

840


Is shell a part of kernel?

765


How to find duplicate record in file using shell script?

1079


c program the catches the ctrl-c(SIGINT) Signal for the first time and prints a output rather and exit on pressing Ctrl-C again

5923


What language is bash written in?

769