Link to home
Start Free TrialLog in
Avatar of anju_a_sagar
anju_a_sagarFlag for United Kingdom of Great Britain and Northern Ireland

asked on

operand expected

Dear All,
I m trying to execute this command
X60=$(($1 * 60))
error showing : operand expected (error token is " * 60")
TOTMINUTES=$(($X60 / $2))
error : operand expected (error token is "/")
how to eliminate this error
do i need to define using awk?
thanks
Avatar of ozo
ozo
Flag of United States of America image

are $1 and $2 defined?
Avatar of anju_a_sagar

ASKER

no how can i define them?
i know abt normal variables
can u plz explain
What did you want to multiply by 60?
What did you want to divide it by?
awk -f traveltime "$1" "$2"
is it like this
i want to give those variables as user input
like this
traveltime 90 40
90 for $1 and 40 for $2
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
do i need to write in a file and save it with particular extension?
X60=$(($1 * 60))
when i run this command
the following error is coming
-bash: * 60 : syntax error : operand expected (error token is "* 60")
thanks