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

What is the first line of a shell script called?

1094


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

1081


How will you emulate wc –l using awk?

1545


What are different types of shell?

937


Is shell a scripting language?

1024


What does path stand for?

1074


How important is shell scripting?

1058


What is the equivalent of a file shortcut that we have a window on a linux system?

1141


What is the use of "$?" Sign in shell script?

1182


How do I open the shell prompt?

1207


How to debug the problems encountered in the shell script/program?

1156


Which shell is the best?

1007


How do I set bash as default shell mac?

1021


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

4077


What language is bash?

931