Visit Our UNIX and Linux User Community

Syntax error calling TCL script from shell script

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Syntax error calling TCL script from shell script
# 1  
Old 03-13-2011
Syntax error calling TCL script from shell script

hello everyone
i am beginner on shell scripting .and i am working on my project work on ad hoc network
i wrote a batch (.sh) to do a looping and execute a tcl script i wrote before in each iteration ..but i got this problem "
syntax error near unexpected token `('
/home/marcoss/ns-allinone-2.34/ns-2.34/adrouting.tcl  line 6: `set val(seed)               [lindex $argv 2];


it can not accept my third input argument to my tcl script ( ${tarry[$i]}) !!!

this is my shell script :
#! /bin/sh
function rout () {


for (( i=0; i<$q; i++))
 echo ${tarry[$i]}

for (( i=0; i<$q; i++))
/home/marcoss/ns-allinone-2.34/ns-2.34/adrouting.tcl  10Mb  /home/marcoss/work ${tarry[$i]}  dsr > /dev/null

for (( i=0; i<$q; i++))
/home/marcoss/ns-allinone-2.34/ns-2.34/adrouting.tcl  10Mb   /home/marcoss/work ${tarry[$i]} aodv > /dev/null

for (( i=0; i<$q; i++))
/home/marcoss/ns-allinone-2.34/ns-2.34/adrouting.tcl  10Mb  /home/marcoss/work ${tarry[$i]}  dsdv > /dev/null

(xMb , /home/marcoss/....., ${tarry[$i]} ,aodv) are my tcl input arguments

so do not know what is this error mean and what shall i do ..!!!???

kindly regards your efforts...

Last edited by pludi; 03-13-2011 at 11:16 AM.. Reason: Code tags, Subject
# 2  
Old 03-13-2011
could you post your complete code?

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Calling Shell script Error

Hi All, I need to call a script in another server(Say B).So I logged in my local Machine(say A)using putty and given these command ssh root@hostname cd home\oracle sh This is working perfectly.But when I have those command in a shell script and placed in my local... (2 Replies)
Discussion started by: Nivas
2 Replies

2. Shell Programming and Scripting

Calling shell script within awk script throws error

I am getting the following error while passing parameter to a shell script called within awk script. Any idea what's causing this issue and how to ix it ? Thanks sh: -c: line 0: syntax error near unexpected token `newline' sh: -c: line 0: `./ ... (10 Replies)
Discussion started by: Sudhakar333
10 Replies

3. Shell Programming and Scripting

Compare two initoras shell script syntax error

Hi All, I am executing the below shell script to compare two initoras files which is ending up in syntax error as below: -bash-3.2$ cat #!/bin/bash file1=$1 file2=$2 for parameter in `cat $file1 | grep = | awk '{print $1}' | grep -v '#'` do value1=`grep... (4 Replies)
Discussion started by: a1_win
4 Replies

4. Shell Programming and Scripting

syntax error in shell script

I am creating a shell script. In which, I need to get server name and server IP. I used this command in script. servername=`cat /etc/hosts|grep `eval hostname`|awk '{print $2}'` however, when execute script or put set -x to debug, it return: line 13: syntax error at line 13: `|' unexpected... (4 Replies)
Discussion started by: duke0001
4 Replies

5. Shell Programming and Scripting

Syntax Error in Unix Shell Script

I am trying to run a unix script in my home directory.Snippet below echo "`date '+%Y%m%d_%H%M%S'` Getting ProductList.dat" if ( -f $DIR/ProductList.dat) then cp $DIR/ProductList.dat MigratedProductList.dat else echo "`date '+%Y%m%d_%H%M%S'`ProductList.dat does not exist; Processing... (4 Replies)
Discussion started by: Mary James
4 Replies

6. Shell Programming and Scripting

Error in calling a shell script from another script

HI, We are using two shell scripts,,, where will be called inside The variable inside is used as $var in while running the script its not identifying that variable. Is there any permission needed to call a script inside another script. ... (3 Replies)
Discussion started by: banupriyat
3 Replies

7. Shell Programming and Scripting

Error when calling sybase stored proc from shell script

Hi, I am writing a script that needs to call a stored proc which would update a column in a table based on a condition. I need to also capture the number of rows updated. However, When I execute the script I keep getting this error: ./ syntax error at line 33: `end of file'... (3 Replies)
Discussion started by: karthikk
3 Replies

8. Shell Programming and Scripting

Help on shell script : syntax error at line 62: `end of file' unexpected

Hi All, I have written a korn script (code pasted below). It is giving the error while debugging " syntax error at line 62: `end of file' unexpected". I have re-written the whole code in VI and explored all help related to this error on this Unix forum and tried it. Somehow, I could... (7 Replies)
Discussion started by: schandrakar1
7 Replies

9. UNIX for Dummies Questions & Answers

awk Shell Script error : "Syntax Error : `Split' unexpected

hi there i write one awk script file in shell programing the code is related to dd/mm/yy to month, day year format but i get an error please can anybody help me out in this problem ?????? i give my code here including error awk ` # date-month -- convert mm/dd/yy to month day,... (2 Replies)
Discussion started by: Herry
2 Replies

10. Shell Programming and Scripting

Correct Syntax For Calling Shell Script in Perl Module

Problem: I have a shell script that will be called by a Perl module that will connect to a db and delete rows. The Perl module will be called by CRON. I am using a Perl module to call a shell script because I need to get the db connection from Perl. Here is the Perl pseudocode: ... (4 Replies)
Discussion started by: mh53j_fe
4 Replies

Featured Tech Videos