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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is bash used for?

569


What is shell variable?

523


What is awk script?

536


How to print all array elements and their respective indexes?

499


How do I set bash as default shell mac?

547






What is gui scripting?

595


How do you debug a script?

556


Print the 10th line without using tail and head command.

1658


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

921


What does sh mean?

608


what is info area how many types?

2277


What is bash coding?

489


c program the catches the ctrl-c(SIGINT) Signal for the first time and prints a output rather and exit on pressing Ctrl-C again

5187


What are types of shells?

535


what is tickets $ what low,medium,high priorite pls define time also

1711