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"



Create a bash shell script that reads a line from the user consisting of 5 words and then prints th..

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

Post New Answer

More Shell Script Interview Questions

What is difference between bash and shell?

0 Answers  


What is $1 in shell scripting?

0 Answers  


write a shell script to find the largest number from 3 given numbers.

6 Answers  


What is the command to find out today's date?

0 Answers  


What is ms powershell?

0 Answers  


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.

5 Answers   Wells Fargo,


What is the basic difference you find between a shell script and perl?

3 Answers   Yahoo,


Dear All, Can anybody tell me how to predefind no. of selected rows from a text file.

1 Answers   MGL,


Can we run shell script in windows?

0 Answers  


What are the four fundamental components of every file system on linux?

0 Answers  


Explain about debugging?

0 Answers  


Which shell is the best?

0 Answers  


Categories