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 can you get the value of pi till a 100 decimal places?
How to get script name inside a script?
What does the sh command do?
What are the zombie processes?
What is the crontab?
RAM one table colums a1,a2,a3,a4 respective values 2,4,7,8 KRISH one table colums a1,a2,a3,a4 respective values 3,4,6,9 IN RAM & KRISH a4 column if comparing values RAM A4 - KRISH A4 ( 8-9 =1 THEN print 5 or (RAM) a4 value 10 KRISH a4 values 2 then 10 -2 =8 print 5*8=40 or diff 5 print same
what does "kill -9" and "kill -1" do
What happens on a system call?
What is the use of "test" command?
How to calculate the number of passed arguments?
write a shell script to check the failed jobs?
Rewrite the command to print the sentence and convert the variable to plural: echo “i like $variable”.