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 / 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 |
Why is a script important?
What is wc in shell script?
shell script for reverse the string
What does the sh command do?
What is the use of "test" command?
What is echo in shell?
How to redirect both standard output and standard error to the same location?
Can we run shell script in windows?
How to print all the arguments provided to the script?
How to enable the shell to know what program should be run to interpret the script?
Is shell script a programming language?
How to customise the existing shell?