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
Write down the syntax for all the loops in shell scripting.
What language is shell scripting?
How to get the first line from a file using just the terminal?
Is shell scripting a language?
What is bourne shell scripting?
How to calculate the number of passed arguments?
What is @echo off?
What is the equivalent of a file shortcut that we have a window on a linux system?
Devise a script that takes file name as arguement(which must present in the current directory)and locates from your home directory tree all thpath names of its links.Then mail the list to self.
What is the first line in a shell script?
What are the 3 standard streams in linux?
How can I set the default rwx permission to all users on every file which is created in the current shell?
wats the deinitions for shell utility and filter?
What are the advantages of shell scripting?
Why do we use shell scripting?