Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

exec does not work

Status
Not open for further replies.

stoffel67

Programmer
Jun 13, 2013
3
EU
Hi,
I try to do the following:
set cmd "rrdtool create c://rrdtool//Gas1.rrd --start 1360279400 --step 600 DS:AGas:GAUGE:900:U:U DS:DGas:GAUGE:900:U:U RRA:MAX:0.5:1:1008"
exec $cmd

this work's OK, the DB is created!
but within a procedure:
proc db_create {} {
set cmd "rrdtool create c://rrdtool//Gas1.rrd --start 1360279400 --step 600 DS:AGas:GAUGE:900:U:U DS:DGas:GAUGE:900:U:U RRA:MAX:0.5:1:1008"
exec $cmd
}
it does not work, I get an error:
couldn't execute "rrdtool create c:\rrdtool\Gas1.rrd --start 1360279400 --step 600 DS:AGas:GAUGE:900:U:U DS:DGas:GAUGE:900:U:U RRA:MAX:0.5:1:1008": no such file or directory

What am I doing wrong here????
Any help would be appreciated.
Thanks
Stef


 
Sometimes, scope is peculiar. Try, just to see what happens, building the command string outside the proc and passing it in as an argument.

_________________
Bob Rashkin
 
Hi Bob,
same effect!!

couldn't execute "rrdtool create c:\rrdtool\Gas1.rrd --start 1360279400 --step 600 DS:AGas:GAUGE:900:U:U DS:DGas:GAUGE:900:U:U RRA:MAX:0.5:1:1008": no such file or directory

without all the parameter to "rrdtool" the program is started.
the problem seems to be the parameter list.
 
Hi,
I think I got the solution from another TCL-forum:
eval exec did the trick.

proc db_create { cmd } {
eval exec $cmd
}



 
Usually, I think that means that some substitution needs to be made prior to "exec". I don't see what that would be but oh well.

_________________
Bob Rashkin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top