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

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which scripting language is best for automation?

704


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.

2030


I want to connect to a remote server and execute some commands, how can I achieve this?

772


What is a boot block?

746


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

817


What is wc in shell script?

723


What is a batch file used for?

768


What is shell prompt?

722


Explain about return code?

800


How will you find the 99th line of a file using only tail and head command?

2243


Which shell is the best?

739


What is sudo command?

733


Is shell script a programming language?

722


write a shell script to emulate the Id command of PRIMOS which lists files and directories. It list files first with a header FILES and then directories with a header DIRECTORIES. This command has several options. The main ones are. -file select files only -dir select directories only -reverse sort in reverse order -no_header put no header on the output -brief output the header only -size display the size of each file -help display Id´s syntax and options.

2429


What is shell geeksforgeeks?

757