HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- queries on command 'exit [n] '
Operating System - HP-UX
1828409
Members
3576
Online
109977
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2005 06:00 PM
03-31-2005 06:00 PM
Hi guys,
for "exit n" command, what does the n signifies.. i only knows that the program exit with that specific status. but what does this means
does n= 0, 1, 2 3.... each having an unique meaning when passed on with exit?
what is the different if I exit with 0 or 1?
thank u =)
for "exit n" command, what does the n signifies.. i only knows that the program exit with that specific status. but what does this means
does n= 0, 1, 2 3.... each having an unique meaning when passed on with exit?
what is the different if I exit with 0 or 1?
thank u =)
Solved! Go to Solution.
- Tags:
- exit status
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2005 06:25 PM
03-31-2005 06:25 PM
Re: queries on command 'exit [n] '
exit command to leave a shell program with a certain exit status. The default exit (no arguments) will exit the shell program with the status of the last command executed. Refer man pages on exit.
The usual exit statuses are:
0 Success.
1 A built-in command failure.
2 A syntax error has occurred.
3 Signal received that is not trapped
sks
The usual exit statuses are:
0 Success.
1 A built-in command failure.
2 A syntax error has occurred.
3 Signal received that is not trapped
sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2005 06:26 PM
03-31-2005 06:26 PM
Re: queries on command 'exit [n] '
Hi Henry,
I guess it do not have any special meaning since it is define. One purpose I can see we this is when in a very nested program you can easily identify where did you program exit which the value of $? could be use with other program.
my 2 cents.
Regards,
Paul
I guess it do not have any special meaning since it is define. One purpose I can see we this is when in a very nested program you can easily identify where did you program exit which the value of $? could be use with other program.
my 2 cents.
Regards,
Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2005 06:27 PM
03-31-2005 06:27 PM
Solution
Whan a script exists with status 'n' (i.e exit n), the
script returns 'n' to the shell that invokes the script.
Typically, an exit status of 0 is considered success
and non zero as failure.
For example, consider this simple script (let's
call it exit_demo):
-- Start script exit_demo --------
# Demo script
exit $1
----- End script
Now run this script and check exit status:
# exit_demo 0
# echo $?
0
# exit_demo 5
# echo $?
5
Did I explain that clearly?
- Biswajit
script returns 'n' to the shell that invokes the script.
Typically, an exit status of 0 is considered success
and non zero as failure.
For example, consider this simple script (let's
call it exit_demo):
-- Start script exit_demo --------
# Demo script
exit $1
----- End script
Now run this script and check exit status:
# exit_demo 0
# echo $?
0
# exit_demo 5
# echo $?
5
Did I explain that clearly?
- Biswajit
:-)
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP