Nohup causing issues


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Nohup causing issues
# 1  
Old 11-09-2009
Nohup causing issues

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
# 2  
Old 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.
# 3  
Old 11-09-2009
Code:
/cms_inbBroker.sh: function: not found

Looks like the script is not executed by ksh/bash. Put
Code:
!#/usr/bin/?sh

at the beginning of your script.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

How to know which process is causing the closed_wait?

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

2. Shell Programming and Scripting

Saving nohup output to a file other than nohup.out

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

3. AIX

Which Process is causing Paging?

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

4. Shell Programming and Scripting

Script causing database corrupt

Hi, Closing the thread (3 Replies)
Discussion started by: dbashyam
3 Replies

5. Shell Programming and Scripting

Simple While read causing issues

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

6. Solaris

Established connections causing lag?

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

7. UNIX for Dummies Questions & Answers

GCC causing problems it seems.

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

8. Solaris

Explorer causing syslog error

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

9. UNIX for Dummies Questions & Answers

Causing a disk to be corrupt

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

10. Post Here to Contact Site Administrators and Moderators

HTML is causing problems

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
Login or Register to Ask a Question