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...


write a non recursive shell script that accepts any number
of arguments and prints them in the reverse order

Answers were Sorted based on User's Feedback



write a non recursive shell script that accepts any number of arguments and prints them in the rev..

Answer / naresh babu

echo "no of arguments:$#"
echo "arguments in reverse order:"
for i in $*
do
j=$i" "$j
done
echo $j

Is This Answer Correct ?    26 Yes 9 No

write a non recursive shell script that accepts any number of arguments and prints them in the rev..

Answer / drths

$ sh rev.sh 123 ---Script name with 1 cmd line argument
------------------------------
#! /bin/sh
abc=$1 ###123 will store in abc
pqr=`echo $pqr | rev` ### 123|rev
echo $abc
-----------------------------
o/p : 321

Is This Answer Correct ?    0 Yes 5 No

write a non recursive shell script that accepts any number of arguments and prints them in the rev..

Answer / amar

./reverse frg gh rtyh
no of arguments:3
arguments in reverse order:
rtyh gh frg

Is This Answer Correct ?    0 Yes 8 No

Post New Answer

More Shell Script Interview Questions

Please anyone suggest atleast 2 good training institutes in Hyderabad, INDIA where i can learn unix shell scripting.

1 Answers  


how to delete all the files with extension .dat rom a directory tree from root to third level in a single unix command?

4 Answers  


What are the advantages of using shell scripts?

0 Answers  


Explain how you Automate your application using Shell scripting.

0 Answers   MAHINDRA,


What does echo mean in scripting?

0 Answers  


What is $1 in shell scripting?

0 Answers  


What is the need of including script interpreter in your shell script?

2 Answers  


What are the three main forms of enabling debugging in a shell script?

6 Answers   ADC, Wipro,


Is shell scripting a language?

0 Answers  


how to get part of string variable with echo command only?

0 Answers  


What are the advantages of shell scripting?

0 Answers  


How would you print just the 25th line in a file using smallest shell script?

4 Answers  


Categories