Nohup with ampersand & process gets disconnected


 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Nohup with ampersand & process gets disconnected
# 8  
Old 04-04-2019
Portability: /bin/sh is present on every *X OS. (Well, SCO Unix and an old HP-UX might need the workaround ${1+"$@"} for a historic bug with "$@".)
It works with any compatible shell, too.
# 9  
Old 04-04-2019
Quote:
Originally Posted by gandolf989
Cool script. I will have to test it and see how it works. Did you use the Bourne shell for a particular reason?
Why not use the Bash shell? Thanks
This script doesn't actually need bash, so it's better to use the more portable /bin/sh. It can be carried to AIX or whatever without compatibility worries.
# 10  
Old 04-04-2019
Unfortunately, for backwards compatibility reasons /bin/sh on Solaris systems (at least up until Solaris 11) is a pure 1980's Bourne shell. To get a POSIX conforming shell on Solaris systems, their man pages, indirectly, say to use /usr/xpg4/bin/sh.
# 11  
Old 04-08-2019
I tested screen on several servers and it works really well. No problems so far. Thanks.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problems with ampersand (&) in sed command

Hello everybody, I have a Problem with sed command. I want to replace a defined string with a string from a database field (dynamic). e.g. sed -i -e 's/%NAME%/'"$HNAME"'/g' The Problem is that the $HNAME variable can contain Special characters like '&' e.g. HNAME="AH Kruger & Co. KG" ... (1 Reply)
Discussion started by: Bambuti2000
1 Replies

2. UNIX for Dummies Questions & Answers

Difference between & and nohup &

Hi All, Can anyone please help me understanding what the difference between the below two? 1. script.sh & 2. nohup script.sh & (2 Replies)
Discussion started by: Anupam_Halder
2 Replies

3. UNIX for Advanced & Expert Users

Running process in nohup

Hi All, I am facing issue in running a process in nohup. I ran a process in terminal since it is taking too long to complete I need to make it as background and nohup. I tried below and was able to make it in back ground 1. Cntrl + Z 2. bg I am using Korn Shell so disown is not working... (5 Replies)
Discussion started by: arunkumar_mca
5 Replies

4. UNIX and Linux Applications

nohup and & versus functions

when i have a function definition and function call in my script , i am unable to run my script in background with nohup.. Help me out please..... (3 Replies)
Discussion started by: venugopalsmartb
3 Replies

5. Shell Programming and Scripting

Understanding ampersand (&) usage in the command

Please explain the usage of ampersand in the following command who & echo "Total number of users are `who|wc -l`" What I understand is that ampersand is used to run some process in the background. And, what I am expecting from this command is "Output of who should be displayed on the... (2 Replies)
Discussion started by: Shan_u2005
2 Replies

6. UNIX for Dummies Questions & Answers

nohup & mpiexec problems

Hi everyone - I'm trying to start a run of LAMMPS (which takes an input file) with mpiexec on multiple processors. I want to combine this with nohup so that I can log off the node. I've used the syntax below successfully on one cluster, but it doesn't work on the new one I'm using. Any... (0 Replies)
Discussion started by: erin85
0 Replies

7. Shell Programming and Scripting

Execute Script using nohup and &

Hi all, I have one script test.sh for which I pass two arguments. In the same script I need to submit this script in background using nohup. My script like this and it is working in HP-UX os but not Solaris. #! /bin/sh if then MTR_PID=$$ export MTR_PID echo "test.sh $1 $2... (3 Replies)
Discussion started by: sridhar_423
3 Replies

8. UNIX for Advanced & Expert Users

nohup and background process

What is the difference between running a process using nohup and running a process in background ? Please explain (6 Replies)
Discussion started by: srksn
6 Replies

9. Shell Programming and Scripting

pid of nohup process

I want to print the pid of a nohup process to a file so later I can use the list of pid's in that file to stop the background processes again. I use ksh on AIXv5.3: nohup /start/script.ksh 1>/dev/null 2>&1 print $$ > .pid nohup /start/script2.ksh 1>/dev/null 2>&1 print $$ >> .pid But... (2 Replies)
Discussion started by: rein
2 Replies

10. Shell Programming and Scripting

nohup process hangs

Hi All, I tried searching for this, but I have yet to find anything useful. So here goes, if a script executed from another script with nohup & hangs, does it affect the parent script? Reason I ask, we have a windows box with NFS, and we use it to store some of our files. Currently, I mount the... (2 Replies)
Discussion started by: Sully
2 Replies
Login or Register to Ask a Question