Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

how to print the matrix form of 2-d, 3-d arrays in unix c shell scripts ?

4111


What shell is bin sh?

1014


Which is better perl or shell scripting?

1031


What is the use of "$#" in shell scripting?

1128


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?

1215


Write a command sequence to find all the files modified in less than 2 days and print the record count of each.

1580


What is the purpose of scripting?

1156


What are different types of shell?

969


How to get the 3rd element/column from each line from a file?

1235


How to get the first line from a file using just the terminal?

1173


What is the use of break command?

1162


Is shell scripting useful?

1097


What is the difference between bash and shell?

1167


What will happen to my current process when I execute a command using exec?

1124


What is the significance of the shebang line in shell scripting?

1192