TCL: syntax error in expression with "*"


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting TCL: syntax error in expression with "*"
# 1  
Old 11-04-2013
TCL: syntax error in expression with "*"

I'm using tcl scripts in ns2 ( network simulator) through cygwin. It works fine , however, I downloaded an example when i run it , I got the following syntax error:

Code:
syntax error in expression with " *2" : unexpected operator *
while executing :
"expr $bw *2"
invoked from within:
"$ns duplex-link $n1 $n3 [expr  $bw *2] Mb [expr  $rtt_1 /2-1 ]ms DropTail"

I tried to comment this line to see if the error from something else, I got the error whenever there is a line with "*"

Any suggestions??Smilie
# 2  
Old 11-05-2013
Does +2 work?
Is $bw really a number?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. BSD

Keep getting error "-bash: ./.profile_z2: line 52: syntax error: unexpected end of file"

#!/bin/bash #-------------------------------------------------------- # Setup prompt # Author Zeeshan Mirza # Data: 06-08-2017 #-------------------------------------------------------- if then . ./.profile_custom_pre fi umask 022 set -o vi export EDITOR=vi export VISUAL=vi... (3 Replies)
Discussion started by: getzeeshan
3 Replies

2. Shell Programming and Scripting

Help with FTP Script which is causing "syntax error: unexpected end of file" Error

Hi All, Please hav a look at the below peice of script and let me know if there are any syntax errors. i found that the below peice of Script is causing issue. when i use SFTP its working fine, but there is a demand to use FTP only. please find below code and explain if anything is wrong... (1 Reply)
Discussion started by: mahi_mayu069
1 Replies

3. UNIX for Dummies Questions & Answers

redirect for "[: : integer expression expected" error

Hi, I read in this forum that for "https://www.unix.com/shell-programming-scripting/156008-integer-expression-expected-regular-expression.html thanks! (7 Replies)
Discussion started by: Vijay81
7 Replies

4. Shell Programming and Scripting

Bash (Ubuntu server): Syntax error: "|" unexpected in While-loop

Hello forum, I hope my problem is easy to solve for someone in here! My main task is to copy a large amount of imap-accounts from one server to another. There is a tool (Perl) called imapsync which does the job exellent. Unfortunately I'm only able to run it on one account at a time. After... (3 Replies)
Discussion started by: primaxx
3 Replies

5. Shell Programming and Scripting

cshell integer expression from "0000" to "1999"

I have 2000 files named like "file-fr0000.log", "file-fr1999.log"... I wanna generate the file names automatically in the following c shell script: set fr = 0 while ($fr <= 1999) grep "ENERGY" file-fr$fr.log > data.dat @ fr = ( $fr + 1 ) end The above will generate file names... (3 Replies)
Discussion started by: rockytodd
3 Replies

6. Fedora

"integer expression expected" error with drive space monitoring script

Hi guys, I am still kinda new to Linux. Script template I found on the net and adapted for our environment: #!/bin/sh #set -x ADMIN="admin@mydomain.com" ALERT=10 df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output; do #echo $output ... (2 Replies)
Discussion started by: wbdevilliers
2 Replies

7. Shell Programming and Scripting

ksh-script "arithmetic syntax error" comparing strings

Hi all, Iīve already searched the forum but canīt find what i am doing wrong. I am trying to compare two variables using ksh under red hat. The error I get is: -ksh: .: MDA=`md5sum /tmp/ftp_dir_after_transfer | cut -d' ' -f1 ` MDB=`md5sum /tmp/ftp_dir_before_transfer | cut -d' ' -f1 `... (3 Replies)
Discussion started by: old_mike
3 Replies

8. Shell Programming and Scripting

"directory checksum error" when attempting to install tcl

OS: HP-UX Programs I want to install: expect and tcl I'm lost. I bought the book. I began reading the book. I want to install expect. I've been able to download the .z, and extract it successfully. But, of course, it apparently needs tcl and possibly tk also, and ... I... (0 Replies)
Discussion started by: instant000
0 Replies

9. Shell Programming and Scripting

error "integer expression expected" when selecting values

dear members, I am having some difficulties with an automation script that I am writing. We have equipments deployed over our network that generate status messages and I was trying an automated method to collect all information. I did a expect script that telnet all devices, logs, asks for... (4 Replies)
Discussion started by: jorlando
4 Replies

10. Shell Programming and Scripting

"syntax error at line 21 :'done' unexpected." error message"

I am trying to run the script bellow but its given me "syntax error at line 20 :'done' unexpected." error message" can someone check to see if the script is ok? and correct me pls. Today is my first day with scripting. Gurus should pls help out #!/bin/ksh # Purpose: Check to see if file... (3 Replies)
Discussion started by: ibroxy
3 Replies
Login or Register to Ask a Question