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
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 |
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 |
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 |
What is difference between shell and bash scripting?
What are the two files of crontab command?
What does $$ mean in shell script?
Hello all, This is my assignment on shell scripting, can anyone help me regarding this ? Create a shell script which connects to the database In second shell script include the first script for the DB connection Create a table (PRADEEP_DATA) with 2 columns (name, value) In Third shell script include the first script for the DB connection And insert/delete the values from the Table, by accepting input from the user This functionality should be a menu driven Program: 1) Insert to the database a. Name b. value 2)Delete from the database a.Name b.value Exception handling needs to be taken care.
What is bash coding?
What is awk script?
In a file , how to retrieve the lines which are the multiples of 50 ? like 50,100,150th lines etc.
defination of mapfile in winrunner?
Can we run shell script in windows?
What is the basic difference you find between a shell script and perl?
What are the various stages of a linux process it passes through?
What does path stand for?