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 are the different communication commands available in the shell?
What is shell environment?
c program to display the information of given file similar to givan by the unix or linux command ls -l
How can the contents of a file inside jar be read without extracting in a shell script?
What is the default ubuntu terminal?
How will you pass and access arguments to a script in linux?
What are different types of shell?
What are zombie processes?
What is meant by dos operating system?
What is basename in shell script?
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..
How to print the first array element?
c program to implement unix/linux command to block the signal ctrl-c and ctrl-\ signal during the execution ls -l|wc -l
How important is shell scripting?
How to print all array elements and their respective indexes?