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
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 |
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 |
sort $1 | uniq > output | echo "`cat output`"
| Is This Answer Correct ? | 1 Yes | 2 No |
How would you compare the strings in a shell script?
What is the difference between bash and shell?
write a scwipt that a) takes exactly one argument, a directory name. b) if the number of argument is more or less than one,print a usage message c) if the argument is not adirectory, print another message d) for the given directory, print the five biggest files and the five files that were most recently modified. e) save the output to a file called q2output.
how to search for vowels a,e,i,o,u appearing in the same sequence in a file
what is the meaning of First line of shell script ,what is meaning of #! pleas explain brifly
What is shell scripting used for?
What is use of "cut" command?
How to get the last line from a file using just the terminal?
Explain about non-login shell files?
What is awk script?
What is scripting autism?
What is a scripting language simple definition?