Linux help

nadman123

Junior member
  • Mar 12, 2008
    53
    0
    6
    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

    Active member
  • Mar 26, 2007
    6,152
    1
    38
    41
    #!/bin/bash


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

    nadman123

    Junior member
  • Mar 12, 2008
    53
    0
    6
    ICE said:
    #!/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