|
|
Return status from expect to csh script
I have a csh script that executes an expect (TCL) script and I can't
get any return result from the expect script. Any ideas?
Here is a snippet of what I mean:
csh script:
--------------------
#!/bin/csh
@ returnStatus 0
expect script.tcl
@ returnStatus += $status
--------
tcl script:
------
<some tcl/expect code>
exit 1
-------
Even though I exit the tcl script with exit code 1 it will not be
catched by the csh script. The csh script works perfect if I instead
call another shell script of any kind.
I also tried to use "return 1" instead of exit in the expect script
but without correct status in the csh script.
(If I remember correctly it should be possible to use either exit or
return in expect?)
Cheers,
Nergal
|
|
0
|
|
|
|
Reply
|
nergal (18)
|
7/13/2007 7:59:29 AM |
|
nergal <nergal@nergal.se> writes:
> I have a csh script that executes an expect (TCL) script and I can't
> get any return result from the expect script. Any ideas?
You have either mis-diagnosed the problem, or your 'expect' is broken:
[paul@amoeba ~]$ expect
expect1.1> exit 1
[paul@amoeba ~]$ echo $status
1
[paul@amoeba ~]$ echo "exit 42" > junk.tcl && expect junk.tcl; echo $status
42
[paul@amoeba ~]$ expect -version
expect version 5.39.0
Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
|
|
0
|
|
|
|
Reply
|
ppluzhnikov-nsp (516)
|
7/13/2007 2:01:51 PM
|
|
|
1 Replies
89 Views
(page loaded in 0.04 seconds)
Similiar Articles: getting return status of a command in csh - comp.unix.solaris ...Why are you wasting your time scripting stuff in csh? Do a search for "csh why ... begginer: setting the exit status - comp.lang.awk getting return status of a command in csh ... begginer: setting the exit status - comp.lang.awkgetting return status of a command in csh - comp.unix.solaris ... begginer ... The exit status of a command - Linux Shell Scripting Tutorial - A ... Exit Status. Capture windows command return code to variable in awk script ...If I add this line before the return in have_program, the > script does what I expect it to: > close("which ... thought - i.e., you still aren't getting the exit status of ... Weird nohup issues - comp.unix.solarisHello all I made a simple script that I want to run on a sun box, I dont have root ... to post what line of the script is failing, what it is doing, and what you expected it ... Regression script - comp.lang.vhdlIt could be in Perl, tcl or c-shell (or for ... useful, as it can tell you about the status ... server queues requests, but your script would have to handle the return codes ... how to simulate press "spacebar, enter, esc keys" at the unix ...... press spacebar" at the script??? > > >> Use expect ... How to enter a return key in bash script? - The ... Shell Programming and Scripting Post questions about KSH, CSH, SH ... API for Ciscpo VPN client? - comp.dcom.sys.ciscoThese scripts use expect to connect via the Cisco VPN client. For ... We have used a Java class, ExpectJ, which mimics Unix Expect, except it doesn't return the status ... exec in AWK - comp.lang.awkI have a shell script that effectively just ... Remove +SIGNS and www. if you expect an answer ... Execute the command cmd-line, and return the exit > status. exit a script, but don't exit matlab - comp.soft-sys.matlab ...The command you want is "return" radar <lcaruso ... how to match "$" in expect, instead of using it as a ... ksh script, exit status and pipe - comp.unix.admin exit a script ... How can I send a break to a remote machine? - comp.unix.solaris ...But I need to send it from a shell script. Note that tip ... Either run tip from "expect", or write your own little C ... tcsendbreak (fd, 0); return (0 ... Return status from expect to csh script - Der Keiler UNIX: The ...I have a csh script that executes an expect (TCL) script and I can't get any return result from the expect script. Any ideas? Here is a snippet of what I mean: Unix & Linux: Return status from expect to csh script ...programming.itags.org: Unix & Linux question: Return status from expect to csh script, created at:Sun, 18 May 2008 22:24:00 GMT with 780 bytes, last updated: Sunday ... 7/25/2012 8:24:13 AM
|
|
|
|
|
|
|
|
|