Solved

operand expected

Posted on 2008-10-20
9
1,160 Views
Last Modified: 2013-12-26
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
0
Comment
Question by:anju_a_sagar
  • 6
  • 3
9 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 22756639
are $1 and $2 defined?
0
 

Author Comment

by:anju_a_sagar
ID: 22756656
no how can i define them?
i know abt normal variables
can u plz explain
0
 
LVL 84

Expert Comment

by:ozo
ID: 22756673
What did you want to multiply by 60?
What did you want to divide it by?
0
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 

Author Comment

by:anju_a_sagar
ID: 22756682
awk -f traveltime "$1" "$2"
is it like this
0
 

Author Comment

by:anju_a_sagar
ID: 22756690
i want to give those variables as user input
like this
traveltime 90 40
90 for $1 and 40 for $2
0
 
LVL 84

Accepted Solution

by:
ozo earned 500 total points
ID: 22756757
if traveltime is a bash script containing

#!/bin/bash
X60=$(($1 * 60))
TOTMINUTES=$(($X60 / $2))
echo $TOTMINUTES


then calling it like
traveltime 90 40

should print
135
0
 

Author Comment

by:anju_a_sagar
ID: 22757216
do i need to write in a file and save it with particular extension?
0
 

Author Comment

by:anju_a_sagar
ID: 22757267
X60=$(($1 * 60))
when i run this command
the following error is coming
-bash: * 60 : syntax error : operand expected (error token is "* 60")
0
 

Author Closing Comment

by:anju_a_sagar
ID: 31507782
thanks
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
dog bark java program 15 98
has22 challenge 11 96
Window placement 17 83
wordappend challenge 8 181
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question