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
how to print the matrix form of 2-d, 3-d arrays in unix c shell scripts ?
What shell is bin sh?
Which is better perl or shell scripting?
What is the use of "$#" in shell scripting?
In my bash shell I want my prompt to be of format '$"present working directory":"hostname"> and load a file containing a list of user-defined functions as soon as I log in, how will you automate this?
Write a command sequence to find all the files modified in less than 2 days and print the record count of each.
What is the purpose of scripting?
What are different types of shell?
How to get the 3rd element/column from each line from a file?
How to get the first line from a file using just the terminal?
What is the use of break command?
Is shell scripting useful?
What is the difference between bash and shell?
What will happen to my current process when I execute a command using exec?
What is the significance of the shebang line in shell scripting?