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)
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)