On Sun, July 26, 2009 6:07 pm, William Scott wrote: > On Sun, July 26, 2009 5:38 pm, Edward A. Berry wrote: >> William Scott wrote: >> .. >>> So I think your process is getting killed before you look at the cat in >>> the box. If it is a question of ${CCP4I_TCLTK} not getting assigned, >>> the >>> error you should see looks like this: >>> >>> bash: /bltwish: No such file or directory >>> bash: exec: /bltwish: cannot execute: No such file or directory >>> >> >> It seems bash treats undefined variables as the null string: >> bash-3.2$ echo ${wxyz}/abc >> /abc >> >> while csh prints an error message, but not like the OP's: >> oswego 185% echo ${wxyz}/abc >> wxyz: Undefined variable. >> >> apparently tcl gives the error message reported: >> oswego 187% tclsh >> % printf ${wxyz}/abc >> can't read "wxyz": no such variable >> >> So I think the "exec" is successful but some ensuing tcl script is >> not inheriting the environment. >> > > The exec is working both with bash/sh and zsh examples, but the string > "source [file join $env(CCP4I_TOP) bin ccp4i.tcl]" isn't getting passed > into the wish shell in any of these. The script as written doesn't work. > Maybe you need a here string. If you run the bash/sh example without the > "$0" -- ${1+"$@"}" stuff, and then paste in the source string manually > after the prompt, it does what he wants (i.e., works). >
I think the trick is to put single quotes around the here string, eg, in zsh, this will work: exec ${CCP4I_TCLTK}/bltwish <<< 'source [file join $env(CCP4I_TOP) bin ccp4i.tcl]' By the way, why do all this instead of just issuing the command "ccp4i" ?