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 crontab?
Explain about non-login shell files?
Write a shell script that adds two numbers if provided as the command line argument and if the two numbers are not entered throws an error message.
determine the output of the following command: echo ${new:-variable}
What is a shell environment?
What is bash command used for?
How to print all array elements and their respective indexes?
Explain about gui scripting?
How do I run a .sh file on mac?
How do I run a script from command prompt?
What is echo $shell?
How will you find the 99th line of a file using only tail and head command?
Is powershell a language?
How will you connect to a database server from linux?
How do I run a powershell script?