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 / 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 |
Post New Answer View All Answers
How do I run a bin bash script?
How important is shell scripting?
How do I run a .sh file on mac?
What are filters explain sort with all the options available?
What is bash coding?
Is bash a shell script?
What are the different commands available to check the disk usage?
Write down the syntax for all the loops in shell scripting.
What is basename in shell script?
What is ms powershell?
shell script for reverse the string
What does $@ mean in shell?
What are types of shells?
Calculate a real number calculation directly from the terminal and not any shell script.
How to use arguments in a script?