[Solved] Using nohup


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users [Solved] Using nohup
# 1  
Old 11-20-2012
[Solved] Using nohup

Hi,
on AIX 6.1

Will this work :
Code:
mycommande &

Or it should be :

Code:
nohup mycommande &

It seems that

nohup mycommande &

is faster than :
Code:
mycommande

Thanks.
# 2  
Old 11-20-2012
Code:
nohup mycomande&

Will appear faster as it disconnects from your session and sends all output to nhup.out (by default). The program will not run any faster, however as it is disconnected from your session you can log out and the program will continue to run.
# 3  
Old 11-20-2012
needs a space between & and everything else and you usually redirect output if there is any

Code:
nohup command -o option > ./somefile  &

# 4  
Old 11-20-2012
Quote:
Originally Posted by big123456
Hi,
on AIX 6.1

Will this work :
Code:
mycommande &

Or it should be :

Code:
nohup mycommande &

The correct choice depends on whether or not you want to modify mycommande's signal mask to ignore SIGHUP. Usually that decision is predicated on whether or not a process needs to survive a disconnection/logout. If it does, then use nohup. If not, then don't.

Quote:
Originally Posted by jim mcnamara
needs a space between & and everything else
While it's definitely good style to use that whitespace, it's not required. When not part of a redirection operation (such as dup2'ing descriptors, 2>&1), syntactically, an unescaped ampersand is in the same category as an unescaped semicolon: separator_op.

Regards,
Alister
# 5  
Old 11-20-2012
Thanks to all.
I an it. And it is running. A nohup.out file appeared. After end of operation will this file stay until I remove it ?

I need to verify something before remove it.

Thank you.
# 6  
Old 11-20-2012
Yes, the nohup.out file will stay until you remove it.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with nohup

I have a script test1.ksh (Korn shell) and within that I am calling another script test2.ksh test2.ksh runs for a pretty long time and hence wanted to execute as nohup from within test1.ksh nohup ./test2.ksh Question 1) dont think the above is working , although executing the nohup... (1 Reply)
Discussion started by: alldbest
1 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. UNIX for Dummies Questions & Answers

Nohup

Hi Every one , i wrote a script for nohpu ,which checks the service by using the port number and starts if it doesnt hear the port. It works good untill i colse the session. how to make it work even after closing the session .And aslo how to deamoize this script #!/bin/bash netstat -ptlen |... (2 Replies)
Discussion started by: vikatakavi
2 Replies

4. Shell Programming and Scripting

run shell script under nohup directly [solved]

Hi, i am not able to run the loop in nohup directly. nohup 'for i in $(seq 10); do echo $i;./mscript.sh $i; done' can some one help me how to run this directly in nohup? ---------- Post updated 03-15-12 at 12:20 AM ---------- Previous update was 03-14-12 at 11:59 PM ---------- From... (0 Replies)
Discussion started by: johninweb
0 Replies

5. UNIX for Dummies Questions & Answers

nohup (solved)

Hi, I have been running a program over ssh and it outputs data as a series of netCDF files to a directory. Being new to UNIX I have just found out (much to my delight) that I can run this in the background using nohup and log off while it runs. However it is now outputting to a file called... (0 Replies)
Discussion started by: davcra
0 Replies

6. Shell Programming and Scripting

[solved] merging two files and writing to another file- solved

i have two files as file1: 1 2 3 file2: a b c and the output should be: file3: 1~a 2~b 3~c (1 Reply)
Discussion started by: mlpathir
1 Replies

7. UNIX for Dummies Questions & Answers

When we need nohup

Hi, I've read the man page on nohup. But I still can't see what's the differences if we just send a process to background versus sending a nohup process to background. eg: myprocess & vs nohup myprocess & Without nohup, myprocess would still run uninterruptible at background... (2 Replies)
Discussion started by: ehchn1
2 Replies

8. AIX

nohup.out

I have a program which writes to nohup.out ... over the time this nohup.out becomes a large file and i cannot read the contents of this file using a vi editor.... whe i do a vi nohup.out it gives an error insufficient memory.... do i need to clean this nohup.out periodically ( or compress it... (5 Replies)
Discussion started by: ramky79
5 Replies

9. UNIX for Advanced & Expert Users

Help on nohup

Hi I submitted a long running executable without using nohup. Now, is there any way I can assure to keep that process ON even if my session gets killed? Thanks Bobby (3 Replies)
Discussion started by: bobbyjohnz
3 Replies

10. UNIX for Dummies Questions & Answers

Nohup

Hi, Using nohup it sends output automatically to $HOME/nohup.out - how do I direct this output to another named file instead, so I can run several scripts in the background at once, directing their outputs into individual log files? Cheers (3 Replies)
Discussion started by: miwinter
3 Replies
Login or Register to Ask a Question