except(1) General Commands Manual except(1)NAME
except - reverse the exit code of a program
SYNOPSIS
except program [ arg ... ]
DESCRIPTION
except runs program with the given arguments.
If program exits 0, except exits 100. If program exits 111, except exits 111. If program exits anything else, except exits 0.
SEE ALSO bouncesaying(1), condredirect(1)except(1)
Check Out this Related Man Page
EXITS(2) System Calls Manual EXITS(2)NAME
exits, _exits, atexit, atexitdont, terminate - terminate process, process cleanup
SYNOPSIS
#include <u.h>
#include <libc.h>
void _exits(char *msg)
void exits(char *msg)
int atexit(void(*)(void))
void atexitdont(void(*)(void))
/* Alef only */
void _exits(byte *msg)
void exits(byte *msg)
void terminate(byte *msg)
DESCRIPTION
Exits is the conventional way to terminate a process. _Exits is the underlying system call. They can never return.
Msg conventionally includes a brief (maximum length ERRLEN) explanation of the reason for exiting, or a null pointer or empty string to
indicate normal termination. The string is passed to the parent process, prefixed by the name and process id of the exiting process, when
the parent does a wait(2).
Before calling _exits with msg as an argument, exits calls in reverse order all the functions recorded by atexit.
Atexit records fn as a function to be called by exits. It returns zero if it failed, nonzero otherwise. A typical use is to register a
cleanup routine for an I/O package. To simplify programs that fork or share memory, exits only calls those atexit-registered functions
that were registered by the same process as that calling exits.
Calling atexit twice (or more) with the same function argument causes exits to invoke the function twice (or more).
There is a limit to the number of exit functions that will be recorded; atexit returns 0 if that limit has been reached.
Atexitdont cancels a previous registration of an exit function.
Alef
In Alef, the system call _exits is the same, but its use is discouraged because the run-time system needs to maintain consistency; termi-
nate and exits are the recommended routines. Terminate is called automatically when a task or proc returns from its main function; it may
also be called explicitly. In either case, it frees resources private to the task (which may be the implicit main task within the proc)
and terminates that task. If that task is the last one in the proc, resources private to the proc are then freed. If that proc is the
last one in the program, it calls exits. Exits should only be called in the last proc of a program; it calls any atexit functions (regis-
tered by any proc) and then calls _exits.
In Alef, atexit and atexitdont behave the same as in C.
SOURCE
/sys/src/libc/port/atexit.c
SEE ALSO fork(2), wait(2)EXITS(2)
Hi,
I am trying to understand the significance of the special variables $!,$@ and $? in perl. I have a code block as follows:
eval {
Code Segment 1:
#authenticating to the remote server
$ftpobj -> login($username,$password) or die "Can't login to $remote_host";
... (12 Replies)
Hi
I am writing a script which should read a file and search for certain strings 'approved' or 'removed' and retain only those lines that contain the above strings.
Ex: file name 'test'
test:
approved package
waiting for approval package
disapproved package
removed package
approved... (14 Replies)
i have nasty html file with 2000+ simbols in 1 row...i need to remove whole the code except title="Some title..." and store those into file with titles (the whole text is in variable text)
i've tried something like this:
echo $text | sed 's/.*\(title=\".+\"\).*/\1/' > titles.html
BUT it does... (13 Replies)
Hi,
I'm looking for a way to run a backup in the cron every Friday, except every 4th Friday (as we do monthly backups then).
The monthly backups are not the 4th Friday of each month, but every 4th Friday (i.e. we don't want this backup to run on x Friday, then the Friday 4weeks/28days later).... (16 Replies)
I am using this command to remove all files and folders older than 24 hours;
find /databackup/dbs/* -maxdepth 0 -type d -mtime +0 -exec rm -rf {} \;
However, if/when backups to this folder fail and are not updated, it will completely destroy any backups we have in that folder.
What can I add... (14 Replies)
Hi all,
I have a number of strings like below:
//mnt/autocor/43°13'(33")W/
and i'm trying to get the numbers in this string, for example
431333
please help
thanks ahead (14 Replies)
Using JRE 1.4.2_12 on SCO OpenServer 5.0.7, I was able to use the Java Comm Api to open and close serial ports. After upgrading to JRE 1.4.2_19, the Java Comm Api complains that the ports are in use. Does anyone have any thoughts on how to make 1.4.2_19 work with Java Comm API?
FYI. I was using... (21 Replies)
Hello:
I have a very basic question. I'd like to select all files except for one file. For example, say I want to move all of the files in my current directory to a subdirectory called archive, I would use mv ./* archive/ But what if I want to move all files except for README.txt? Is there an... (19 Replies)
Hi All,
I want to write a script which first check the line counts of a file if its more than 500 it deletes rest except the last 500..
I tried sed but it looks sed counts line numbers from the head & not from tail.. May be I need a wc -l frist then apply if statement & pass on the line count... (17 Replies)
Greetings All,
I would like to find all occurences of a pattern and delete a substring from the all matching lines EXCEPT the first. For example:
1234::group:user1,user2,user3,blah1,blah2,blah3
2222::othergroup:user9,user8
4444::othergroup2:user3,blah,blah,user1
1234::group3:user5,user1
... (11 Replies)
grep -v will exclude matching lines, but I want something that will print all lines but exclude a matching field. The pattern that I want excluded is '/mnt/svn'
If there is a better solution than awk I am happy to hear about it, but I would like to see this done in awk as well. I know I can... (11 Replies)
Hi All,
i have a file like below,
@DB_FCTS\src\Data\Scripts\Delete_CU_OM_BIL_PRT_STMT_TYP.sql
@DB_FCTS\src\Data\Scripts\Delete_CDP_BILL_LBL_MSG.sql
@DB_FCTS\src\Data\Scripts\Delete_OM_BIDDR.sql
@DB_FCTS\src\Data\Scripts\Insert_CU_OM_LBL_MSG.sql... (11 Replies)
I Want to remove all the sub-directories except latest five in any given TGTDIR.
Is there a way to do so without making a cd to TGTDIR?
I have tried the following but not worked.
Thank you.
rm -rf `ls -t $TGTDIR | awk 'NR>5'` (20 Replies)
Hello Unix Guru's,
I need help in the masking Bank Account Number except last 4 digits in the file using either unix command or shell script.
I'm greatly appreciate your help.
File Name: Sample.txt
560|101012|4267||||||||520114025017|Balance_bank|06/30/2018||||151716.41|AUD... (13 Replies)