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 the first line of a shell script called?
What is the use of "$#" in shell scripting?
How will you emulate wc –l using awk?
What are different types of shell?
Is shell a scripting language?
What does path stand for?
How important is shell scripting?
What is the equivalent of a file shortcut that we have a window on a linux system?
What is the use of "$?" Sign in shell script?
How do I open the shell prompt?
How to debug the problems encountered in the shell script/program?
Which shell is the best?
How do I set bash as default shell mac?
how to print the matrix form of 2-d, 3-d arrays in unix c shell scripts ?
What language is bash?