Re: Getting the return value of a command line program




"Mark Okamura" <mark.okamura@xxxxxxxx> wrote in message
news:1152811740.142985.67690@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Thank you gentlemen. I did not realize that "catching" close would
return the program's return value. Tcl makes these tasks easy (with
the group's help)!

Mark


Yes, be glad.

We were doing scripting in awk, and the only way
we could get the return status of an executed program
was to execute a batch file, which in turn executed the
program, then echoed the %errorlevel% to the output, which
was then reparsed by the calling function, which grabbed
the last line of output (the echoed errorlevel).


.



Relevant Pages

  • Re: Can someone help me out of this?
    ... If the above are NOT true, then why do we do awk at all? ... where the script is rading a text file. ... NOTE that the line you just executed set f1 to $1 and ... f2 to $2 so this condition is true so we now execute ...
    (comp.unix.shell)
  • Re: bash/echo/sed/date question (?)
    ... If, in the above script, I use the systemawk ... command to execute "date", ... tells awk to execute the systemfunction on the string "date" so system ... invokes the shell on "date" and then returns a succ/fail return code. ...
    (comp.unix.shell)
  • Re: executing the results of a find/awk command
    ... manually do a post build fix of the reports by moving some files from ... the command, and then execute its output by the second use of backquotes. ... Since your awk script implies that everything is at a fixed depth, ...
    (comp.unix.shell)
  • Re: script to ping a server
    ... If you don't care what type of script, a batch script would be very simple. ... IF %ERRORLEVEL% == 0 enter commandto execute if ping was successful ...
    (microsoft.public.scripting.vbscript)
  • Re: bash/echo/sed/date question (?)
    ... and pass the result to getline. ... tells awk to execute the systemfunction on the string "date" so system ... invokes the shell on "date" and then returns a succ/fail return code. ...
    (comp.unix.shell)