PDA

View Full Version : Linux help


nadman123
04-03-2008, 05:43 AM
a shell script that takes an arbitrary number of command line
arguments and echoes the arguments back to standard output in reverse order
compared with the order they were originally supplied.
e.g. If the arguments were a b c d, the script will sent the output d c b a to
standard output.

ICE
04-03-2008, 01:49 PM
#!/bin/bash


for (( i = $#; i >0; i-- )); do
printf "$i "
done

nadman123
04-04-2008, 07:57 AM
#!/bin/bash


for (( i = $#; i >0; i-- )); do
printf "$i "
done
thnx for the help bro here instead printf should use eval echo..otherwise you will get the numeric instead