Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

except(1) [debian man page]

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

halockrun(1M)						  System Administration Commands					     halockrun(1M)

NAME
halockrun - run a child program while holding a file lock SYNOPSIS
/usr/cluster/bin/halockrun [-nsv] [-e exitcode] lockfilename prog [args] DESCRIPTION
The halockrun utility provides a convenient means to claim a file lock on a file and run a program while holding that lock. As this utility supports script locking, this utility is useful when programming in scripting languages such as the Bourne shell. See sh(1). halockrun opens the file lockfilename and claims an exclusive mode file lock on the entire file. See fcntl(2) fcntl(2)). Then it runs the program prog with arguments args as a child process and waits for the child process to exit. When the child exits, halockrun releases the lock, and exits with the same exit code with which the child exited. The overall effect is that the child prog is run as a critical section, and that this critical section is well-formed, in that no matter how the child terminates, the lock is released. If the file lockfilename cannot be opened or created, then halockrun prints an error message on stderr and exits with exit code 99. You can run this command in the global zone or in a non-global zone. The command affects only the global or non-global zone in which you issue the command. OPTIONS
The following options are supported: -e exitcode Normally, errors detected by halockrun exit with exit code 99. The -e option provides a means to change this special exit code to a different value. -n The lock should be requested in non-blocking mode: if the lock cannot be granted immediately, halockrun exits immediately, with exit code 1, without running prog. This behavior is not affected by the -e option. Without the -n option, the lock is requested in blocking mode, thus, the halockrun utility blocks waiting for the lock to become available. -s Claim the file lock in shared mode, rather than in exclusive mode. -v Verbose output, on stderr. EXIT STATUS
Errors detected by halockrun itself, such that the child process was never started, cause halockrun to exit with exit code 99. (This exit code value can be changed to a different value using the -e option. See OPTIONS. Otherwise, halockrun exits with the same exit code with which the child exited. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWscu | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
fcntl(2), attributes(5) Sun Cluster 3.2 10 Apr 2006 halockrun(1M)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk / grep / Prints all columns except the first one

I have the a file with the following data. File Content. 1249 snf06.3.0 sw version 1.1 code MD5 192F MD4 MD3 1248 sns06.3.0 sw version 1.1 code MD5 192F MD12 1250 sns06.3.0 sw version 1.1 code MD5 192F0\ MD8 1241 sns06.3.0 sw code MD5 19 1243 sn06.3.0 sw version 1.1 code MD5 19 12... (17 Replies)
Discussion started by: knijjar
17 Replies

2. Shell Programming and Scripting

Perl Exception - $!,$?,$@

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)
Discussion started by: DILEEP410
12 Replies

3. Shell Programming and Scripting

Grep and delete lines except the lines with strings

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)
Discussion started by: vj8436
14 Replies

4. Shell Programming and Scripting

How to remove all text except pattern

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)
Discussion started by: Lukasito
13 Replies

5. Shell Programming and Scripting

Cron job every Friday except 4th

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)
Discussion started by: rab
16 Replies

6. Shell Programming and Scripting

Remove all folders within another folder except the lastest 1, 2 or 3.

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)
Discussion started by: damang111
14 Replies

7. Shell Programming and Scripting

How to cut by delimiter, and delimiter can be anything except numbers?

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)
Discussion started by: sunnydanniel
14 Replies

8. Programming

PortInUse Exception in SerialDemo

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)
Discussion started by: rkelly
21 Replies

9. Shell Programming and Scripting

Wildcards and exceptions

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)
Discussion started by: Danny.Boy
19 Replies

10. Shell Programming and Scripting

Deleting all lines except last 500

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)
Discussion started by: ailnilanjan
17 Replies

11. Shell Programming and Scripting

Using sed, awk or perl to remove substring of all lines except the first

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)
Discussion started by: jacksolm
11 Replies

12. UNIX for Advanced & Expert Users

awk print all fields except matching regex

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)
Discussion started by: glev2005
11 Replies

13. Shell Programming and Scripting

Removing duplicates except the last occurrence

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)
Discussion started by: mechvijays
11 Replies

14. UNIX for Dummies Questions & Answers

Remove all the subdirectories except latest 5 inside any given directory

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)
Discussion started by: Devendra Hupri
20 Replies

15. Shell Programming and Scripting

Masking Bank Account Number except last 4 digits in the file

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)
Discussion started by: Pradeep R
13 Replies