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 |
Explore about environment variables?
How u convert string "hi pravin how are you?" to "Hi Pravin How Are You?"
What is the use of "test" command?
What are the disadvantages of shell scripting?
What is inside a seashell?
Is it possible to substitute "ls" command in the place of "echo" command?
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?
How do you rename the files(*.sh) with file names containing space in it?for example "interview question.sh" needs to rename to "interview-question.sh". Appreciate your inputs.Thanks.
how to get part of string variable with echo command only?
c program to check whether all the directories in the path exists has read and write permission
How does ls command work?
How do I set bash as default shell mac?