11-09-2009
Quote:
Originally Posted by
ChicagoBlues
Hi folks... I really need some help soon with this issue I am having when I run my script using 'nohup'. Below is a function 'checkReturn' that my script uses to check whether other functions or tasks errored out with a non-zero exit code.
function checkReturn {
if [ $3 -ne 0 ]; then
echo "Error in step $STEP at line $2: Command return code: $3"
touch "$CMS_INBOUND_QUEUE/${1}_fail.sig"
exit $FAILURE
fi
}
Here is the error I get.... Note that when I run my script without the nohup, it runs fine.
function checkReturn {
./cms_inbBroker.sh: function: not found
+ [ -ne 0 ]
./cms_inbBroker.sh: test: argument expected
Thanks,
- CB
Slightly more context about your script would be helpful. i.e. the context in which your script is run and in which the function is executed.
Running your script "nohup" doesn't mean nuch. So what! If you're running your script in the background and looking for a return code, you're clean out of luck.... it won't return one.
10 More Discussions You Might Find Interesting
1. Post Here to Contact Site Administrators and Moderators
I have to suggest that we turn HTML back off. The problem is that angle brackets are used in code and this is causing stuff to get dropped from posts.
I know that we can use the constructs that PxT mentions in this thread. But look how hard it is to educate folks about code tags and the search... (4 Replies)
Discussion started by: Perderabo
4 Replies
2. UNIX for Dummies Questions & Answers
Hmm, how to ask this without sounding too malicious...
How might one go about causing a disk corruption in OS X specifically or via the command line in UNIX in general?
Doesnt matter the severity of the problem, I just want to scare the person a little, then fix the problem for them.
Any... (1 Reply)
Discussion started by: Yummator
1 Replies
3. Solaris
Hi there, I have upgraded my explorer (SUNWexplo) on a solaris 10 Sparc box from version 3.4 to the latest version (5.5) . However im a little concerned, whenever I run the new explorer either manually or scheduled, I get a syslog event as follows
1 in 0:08:31: Sep 22 17:00:15 fmy.machine.com... (8 Replies)
Discussion started by: hcclnoodles
8 Replies
4. UNIX for Dummies Questions & Answers
Hi, I seem to be getting errors in relation to GCC it seems as I cant upgrade alot of pkgs until I can upgrade or use a later version of GCC.
The error I get is along the lines of ( cc1: error: unrecognized command line option "-Wno-pointer-sign"
*** Error code 1 )
Anyway I was wondering if... (2 Replies)
Discussion started by: Browser
2 Replies
5. Solaris
I'm not to sure how to go about this questions, so I will just ask it and then get criticized. How many Established connections should a V440 be able to support? (4 Replies)
Discussion started by: adelsin
4 Replies
6. Shell Programming and Scripting
Hi,
I have a simple while loop (ksh scripting).
while read ln1
do
echo $ln1
done < $LogDir/$LogFile
the echo statement is displaying log file contents + also the files in $LogDir. I am not sure how it is displaying the files under $LogDir. There is no ls command either in... (3 Replies)
Discussion started by: tostay2003
3 Replies
7. Shell Programming and Scripting
Hi,
Closing the thread (3 Replies)
Discussion started by: dbashyam
3 Replies
8. AIX
Hello
On one of our systems (AIX 5) I am seeing (vmstat) paging intermittently
I want to know which process is causing the paging?
I understand that first I would need to find out which process is consuming most memory
1) Is that right?
2) How to find it out?
3) By googling I found... (8 Replies)
Discussion started by: Chetanz
8 Replies
9. Shell Programming and Scripting
Shell : bash
OS : Oracle Linux 6.4
I want to save the ouput of a nohup command to file other than nohup.out . Below are my 3 attempts.
For both Attempt1 and Attempt2 , the redirection logs the output correctly to the output file. But I get the error "ignoring input and redirecting stderr to... (7 Replies)
Discussion started by: kraljic
7 Replies
10. AIX
I do have a friend who have this script already but lost it. Can you please help to give me a script that can capture the closed_wait on the stack and identify which process using it. I am thinking of using netstat and rmsock. (2 Replies)
Discussion started by: depam
2 Replies
LEARN ABOUT OPENDARWIN
nohup
NOHUP(1) BSD General Commands Manual NOHUP(1)
NAME
nohup -- invoke a utility immune to hangups
SYNOPSIS
nohup [--] utility [arguments]
DESCRIPTION
The nohup utility invokes utility with its arguments and at this time sets the signal SIGHUP to be ignored. If the standard output is a ter-
minal, the standard output is appended to the file nohup.out in the current directory. If standard error is a terminal, it is directed to
the same place as the standard output.
Some shells may provide a builtin nohup command which is similar or identical to this utility. Consult the builtin(1) manual page.
ENVIRONMENT
The following variables are utilized by nohup:
HOME If the output file nohup.out cannot be created in the current directory, the nohup utility uses the directory named by HOME to create
the file.
PATH Used to locate the requested utility if the name contains no '/' characters.
DIAGNOSTICS
The nohup utility exits with one of the following values:
126 The utility was found, but could not be invoked.
127 The utility could not be found or an error occurred in nohup.
Otherwise, the exit status of nohup will be that of utility.
SEE ALSO
builtin(1), csh(1), signal(3)
STANDARDS
The nohup utility is expected to be IEEE Std 1003.2 (``POSIX.2'') compatible.
BUGS
Two or more instances of nohup can append to the same file, which makes for a confusing output.
BSD
July 19, 2001 BSD