Create a bash shell script that reads a line from the user
consisting of 5 words and then prints them out in reverse
order. Name this script "reverse.sh"
Answer Posted / priyanka joshi
read line;
echo $line | awk '{ for ( i = NF; i > 0; i--) print $i}' |
tr "\n" " "
| Is This Answer Correct ? | 5 Yes | 5 No |
Post New Answer View All Answers
What is echo in shell?
Is scripting and coding the same thing?
What is a batch file used for?
What exactly is a shell?
Where is bash history?
What is shift command in shell script?
How do I stop script errors?
i have 2 tables 4 colums table 1 respective values a1 6, a2 8,a3 9,a4 14 & table 2 respective values a1 6, a2 8, a3 9, a4 12. if compare 2 tables 3 colums values same then 4th column values 1)Qes diff >5 then (5 * diff value ) 2)Qes diff <5 the 5 3)Qes diff 5 then 5 print respective values..
What does $@ mean in shell?
Why do we write bin bash in shell scripts?
Tell something about the super block in shell scripting?
What is the command to find out today's date?
What is the difference between grep and egrep?
What is the way to do multilevel if-else's in shell scripting?
Where are cowrie shells found?