if [ "$1" = "-m" ] ; then
until=`expr 60 \* $2`
until=`expr $until + $now`
sec_rem=`expr $until - $now`
echo "-m"
if [ $sec_rem -lt 1 ]; then
echo "$2 is already history !"
fi
fi
andy@7_~/Downloads$ test.sh -s 20
expr: syntax error
-s
20 is already history !
Your sparse "specifications" and problem "descriptions" nor your sloppy and careless data posting, you frequently having to correct yourself, urging people in here to tidy up for you, don't really help find errors and create solutions for you.
That said, run the script with the shell's -x ( --xtrace ) option set and you'll immediately spot the error.
The above diagnostic message tells you that one of your 15 or so expr statements contains a syntax error.
One might guess that the statement in your code:
until=`expr \* $2`
is likely to be one of your problems since multiplication is a binary operator and you have only supplied one operand.
You are correct; none of us are perfect. But, you should be familiar with your code. You should immediately know where to look for expr statements that are used just before you print out the string -s (which your code prints just after the diagnostic message). And, if you had followed RudiC's advice, it would have shown you exactly which of your expr invocations was generating the diagnostic. (Maybe you should have thanked him for the advice instead of telling him that you no longer want his help. You might consider that other people will read your comments and decide they no longer want to help you either.)