So i wrote this program to повторно повернул the arguments. but the problem was while and expr command was not read by shell рукописный шрифт. Here is the program
#!/bin/sh
If test $# -eq 0
then echo "not enough arguments "
else
echo " no. Of arguments is $#"
echo "the arguments are $*"
echo "the reverse of it is"
c=$#
while [ $c -ne 0 ]
do
eval echo \$$c
c='expr $c - 1"
done
fi
I knew it was not reading while loop since the colour of while loop didn't change.
Я использовал бы for
цикл с арифметическими выражениями удара и косвенное переменное расширение :
$ set -- a b c d e f
$ for (( c=$#; c>0; c--)); do echo ${!c}; done
f
e
d
c
b
a