Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

exit(1t) [opensolaris 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. Tcl exit(1T)

Check Out this Related Man Page

pid(1T) 						       Tcl Built-In Commands							   pid(1T)

__________________________________________________________________________________________________________________________________________________

NAME
pid - Retrieve process identifiers SYNOPSIS
pid ?fileId? _________________________________________________________________ DESCRIPTION
If the fileId argument is given then it should normally refer to a process pipeline created with the open command. In this case the pid command will return a list whose elements are the process identifiers of all the processes in the pipeline, in order. The list will be empty if fileId refers to an open file that isn't a process pipeline. If no fileId argument is given then pid returns the process identi- fier of the current process. All process identifiers are returned as decimal strings. EXAMPLE
Print process information about the processes in a pipeline using the SysV ps program before reading the output of that pipeline: set pipeline [open "| zcat somefile.gz | grep foobar | sort -u"] # Print process information exec ps -fp [pid $pipeline] >@stdout # Print a separator and then the output of the pipeline puts [string repeat - 70] puts [read $pipeline] close $pipeline SEE ALSO
exec(1T), open(1T) KEYWORDS
file, pipeline, process identifier 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. Tcl 7.0 pid(1T)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

stderr redirection

Does anyone know away of redirecting the stderr for a bourne or korn shell script to a file. (5 Replies)
Discussion started by: blakmk
5 Replies

2. Shell Programming and Scripting

Perl - Iterating a hash through a foreach loop - unexpected results

i've reworked some code from an earlier post, and it isn't working as expected i've simplified it to try and find the problem. i spent hours trying to figure out what is wrong, eventually thinking there was a bug in perl or a problem with my computer. but, i've tried it on 3 machines with the... (5 Replies)
Discussion started by: quantumechanix
5 Replies

3. UNIX for Dummies Questions & Answers

Where can I find a list of exit codes? (Exit code 64)

I'm receiving an exit code 64 in our batch scheduler (BMC product control-m) executing a PERL script on UX-HP. Can you tell me where I can find a list of exit codes and their meaning. I'm assuming the exit code is from the Unix operating system not PERL. (3 Replies)
Discussion started by: jkuchar747
3 Replies

4. Shell Programming and Scripting

exit status of Invoking two or more scripts in background

I have a sript which is going to trigger other 3 scripts in background simultaneously for eg: Main Script:(main.sh) ----------- sh a.sh & sh b.sh & sh c.sh & How to catch the exit status and store it in a variable for all those three scripts in main script. Is there any other way of... (4 Replies)
Discussion started by: Omkumar
4 Replies

5. Programming

exit(0) versus exit(1)

What is the difference between using exit(0) and exit(1) to exit a program? Which should I use? (9 Replies)
Discussion started by: enuenu
9 Replies

6. Shell Programming and Scripting

problem with I/O script

#!/bin/sh cd / while do $2>/Users/a/new done this is the problem it out puts blanker.sh: line 6: ' any help appreciated (17 Replies)
Discussion started by: cleansing_flame
17 Replies

7. Shell Programming and Scripting

Redirecting stderr problem

% ls -ld /usr /foo ls: /foo: No such file or directory drwxr-xr-x 14 root wheel 512 May 18 02:49 /usr % ls -ld /usr /foo 1>/dev/null/ /dev/null/: Not a directory. % ls -ld /usr /foo 2>/dev/null/ /dev/null/: Not a directory. ^^Why why why doesn't this work for me. Furthermore, where is... (7 Replies)
Discussion started by: phpfreak
7 Replies

8. UNIX for Dummies Questions & Answers

What is meant by "exit $?"

What is meant by "exit $?" (4 Replies)
Discussion started by: santosh149
4 Replies

9. UNIX for Dummies Questions & Answers

Redirect just stderr to a file with a timestamp

I'm using below command to redirect stderr to a file but I also want to add timestamp to stderr.out to find out the date / time the error occurred. ls -ltr 2>>/tmp/stderr.out Thanks (5 Replies)
Discussion started by: mbak
5 Replies

10. Shell Programming and Scripting

Can I pipe stderr to another process

Hi there, I was wondering if it was possible to pipe stderr to another process. I need to eval commands given as arguments and I would like to redirect stderr to another process. I can redirect stderr to a file like this... toto:~$ command="one=1" toto:~$ eval $command 2> error toto:~$... (5 Replies)
Discussion started by: chebarbudo
5 Replies

11. Shell Programming and Scripting

Append stderr

Hi everybody. I was used to redirect stderr to a file in this way, calling a generic script:./myScript &> output.logBut now I need something more sophisticated...Inside a bash script I launch an executable in this way:${command} >> "${globalLogFile}"So I redirect the stdout into globalLogFile.... (14 Replies)
Discussion started by: canduc17
14 Replies

12. Shell Programming and Scripting

TCL/Expect using puts to add data to a file

Hi all, I'm trying to do something that might be basic, but it is not working for me, and I suspect I'm missing something. I appreciate if you can shed a light or offer an alternative. In expect script, I'm opening a file i.e: set file I have a simple proc: proc a {} { puts "Hello... (3 Replies)
Discussion started by: ydekel
3 Replies

13. UNIX for Dummies Questions & Answers

how to get stderr

Hello I try to store stderr into a variable, then if this var is not empty i send an email and stop my script. I think my problem is due of "<$dump" into my command line. my bad command line (see samples below on this post) if ! $returnedStr ; then echo ERROR READING DUMP: ... (8 Replies)
Discussion started by: giova
8 Replies

14. Programming

Return or exit codes apart from 0 have a meaning?

The standard return code when everything goes right is 0, but what about using any other number something happened? Are there "ranges" depending on the kind of problem you want to express or is totally up to the programmer? (3 Replies)
Discussion started by: Tribe
3 Replies

15. UNIX for Beginners Questions & Answers

Confused about redirecting stderr

I know that mmmmm 2> error.txt will send the error message to the specified file instead of the screen. However, I have seen >&2 in some scripts, and I can't get it to do anything. A source said it sends stdout and stderr to a file. What file? Ubuntu 18.04.2; Xfce 4.12.3;... (11 Replies)
Discussion started by: Xubuntu56
11 Replies