exit(n) Tcl Built-In Commands exit(n)
__________________________________________________________________________________________________________________________________________________NAME
exit - End the application
SYNOPSIS
exit ?returnCode?
_________________________________________________________________DESCRIPTION
Terminate the process, returning returnCode to the system as the exit status. If returnCode isn't specified then it defaults to 0.
SEE ALSO
exec(n), tclvars(n)
KEYWORDS
exit, process
Tcl exit(n)
Check Out this Related Man Page
exit(1T) Tcl Built-In Commands exit(1T)__________________________________________________________________________________________________________________________________________________NAME
exit - End the application
SYNOPSIS
exit ?returnCode?
_________________________________________________________________DESCRIPTION
Terminate the process, returning returnCode to the system as the exit status. If returnCode isn't specified then it defaults to 0.
EXAMPLE
Since non-zero exit codes are usually interpreted as error cases by the calling process, the exit command is an important part of sig-
nalling that something fatal has gone wrong. This code fragment is useful in scripts to act as a general problem trap:
proc main {} {
# ... put the real main code in here ...
}
if {[catch {main} msg]} {
puts stderr "unexpected script error: $msg"
if {[info exist env(DEBUG)]} {
puts stderr "---- BEGIN TRACE ----"
puts stderr $errorInfo
puts stderr "---- END TRACE ----"
}
# Reserve code 1 for "expected" error exits...
exit 2
}
SEE ALSO exec(1T), tclvars(1T)KEYWORDS
exit, process
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+--------------------+-----------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+-----------------+
|Availability | SUNWTcl |
+--------------------+-----------------+
|Interface Stability | Uncommitted |
+--------------------+-----------------+
NOTES
Source for Tcl is available on http://opensolaris.org.
Tclexit(1T)
I'm trying to write a script that will update a table in sysbase.
If it's failed then I want to rerun it one more time before exiting the script (fail due to bad value such as trying to put a string into datetime field or bad connection to the database)
Well my code below will always return... (2 Replies)
i have written a shell script that invokes main class of a java prg. the java prg does a System.exit(0) or (1) based on condition. how can i read or check the status in unix.... (4 Replies)
Hi,
I have a trap problem when calling a child script in the background.
I know there are a lot of threads here on the issue of traps and signals, I think I have read all the relevant ones, but still haven't found an answer to my problem.
I'm working on Linux or HP, the script as you can see... (4 Replies)
HI,
I written a shell script to stop my peoplesoft applications.Peoplesoft provides a psadmin utility to stop the application. I used the force shutdown option with it psadmin -c shutdown! -d pskri. When my application process hungs in the background the script is not able to continue and... (3 Replies)
Is it ok to use exit() inside a signal handler?
I catch SIGUSR1 in a signal handler and I try to close a file and then exit. The result is inconsistent. Sometimes the process exit and sometimes it returns to the original state before the signal handler was invoked.
Perhaps exit is not legal in... (8 Replies)
I'm preparing for exam and one of exams is to write own test command...
I wonder if in unix is a command which just returns exit code you specify..
I know I can easily write a function like this:
exStatus() {
return $1
}
-> my question is rather theoretical
thank you! (9 Replies)
hi all,
please tell me clearly the difference between
exit 1 and exit 2
one more question
i want to know the difference between some basic shells like bsh, csh, ksh, bash.
i refered in net i get wast of text pages can any one give me any link to show the diff precisely or any blogs.... (2 Replies)
There is a sh file called "agg.sh",
this is a kind of negative scenario, this script would fail as expected, but the problem is that after executing the script the following o/p is displayed continuosly without returning the control.We have to press "crtrl+c" to exit the script.
... (3 Replies)
Hi,
If I have a large shell script running as root, say for example like one that copies a ton of files, how would I kill the shell script and any processes that it created?
Thanks (7 Replies)
Simply, when i have tool "pdftotext", "sed" or "wget" and if this tool make an error in converting or downloading or something, I want to terminate my script...something like:
if ; then
exit 1
fi
bud I dont know how..can you help guys?:confused: (3 Replies)
Please see below mentioned my script ... it ran once without any issue .... then after it is not coming out .... please suggest what is wrong?
#!/bin/ksh
## if (( ${num_errors} > 0 ));
export ACULOG=/home/varshnes/input
export num_errors=10
**** Search for 'Start correcting roll up... (7 Replies)
I have a scenario, where i need to grep for the information and then exit.
i have to grep for "import done" and "bye" from success.log and then update a file with success if these words are present and failure if they are not present.
can any one help with this scenario? (4 Replies)
I have written the following script to update some Debian boxes.
#!/bin/bash
mxg_hosts_file="/etc/mxg/ssh-hosts"
while read line ; do
mxg_host="$(echo ${line} | awk -F":" '{print $1}')"
mxg_port="$(echo ${line} | awk -F":" '{print $2}')"
echo "Connecting and Upgrading... (3 Replies)
This is WILD! :eek:
Under Ubuntu (where I am cross-posting this problem) I have lately noticed by terminal windows/tabs closing unexpectedly. I finally caught it: I was composing a complicated command so I practices it a few times commented out - that is, with a # at the start of the line. What... (3 Replies)
Hi,
I am writing a shell script where I am sourcing other shell script in that script I have mention exit 0 due to that it is not continue the first script. Except doing any changes to source script is there any way I can continue the my first script. (3 Replies)