?
Solved

operand expected

Posted on 2008-10-20
9
Medium Priority
?
1,188 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses
Course of the Month13 days, 2 hours left to enroll

777 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