Sponsored Content
Top Forums Shell Programming and Scripting Saving nohup output to a file other than nohup.out Post 302878491 by kraljic on Friday 6th of December 2013 10:36:27 AM
Old 12-06-2013
Thank you Cero, RudiC

Cero's (and RudiC's) solution has worked
Code:
nohup test.sh > MyOutput.log 2>&1 </dev/null &

But I didn't quite understand how 'redirecting stdin from /dev/null' work.

Regarding commands to accept Standard Input: I've only used things like below in my career.
sort < unsorted_names_list.txt

And I have only bit bucket /dev/null to discard errors like below.
find / -name "HelloWorld" 2>/dev/null

Can you explain how redirecting stdin from /dev/null got rid of the error ?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

capture nohup log file

Hi, I am running my script using nohup, but I am not able to capture the log file for that process could naybody please help... Here is what I am doing.... nohup ./script & 1>/home/user1/log.txt but I am not able to capture the log.....Is there anyother way I can capture the log... (2 Replies)
Discussion started by: mgirinath
2 Replies

2. UNIX for Dummies Questions & Answers

I want to copy the text output from a 'nohup.out' file.

Hello, I have a nohup.out file that, when executed, outputs a spreadsheet file with four-to-seven columns of number. I want to copy this output (in its entirety), so that I could then paste it on excel@ , or Notepad@. Please help, thanks. (3 Replies)
Discussion started by: Iamthe great
3 Replies

3. UNIX for Dummies Questions & Answers

Route the logs to different file other than nohup.out

Hi guys Right now the standard out and standard err are going to nohup.out file I wanted to route to some other name specific files so that it will be easy to research the logs Example I have this line in my script nohup execute receiptLoaderStart & which is routing the logs to... (6 Replies)
Discussion started by: pinky
6 Replies

4. Shell Programming and Scripting

output nohup file containg the PID

Hi to everybody. Is it possible to nohup a process and redirect the output to a file containing the PID? E.g. if nohup filename > out.nohup associate the PID=8074 to filename, is it possible to call the output file something like out_8074.nohup instead of out.nohup? By this way it would... (0 Replies)
Discussion started by: plsrn
0 Replies

5. Shell Programming and Scripting

nohup output on screen for some time

Hi, I'm executing a binary with nohup in a menu(shellscript) and output is going to nohup.out fine. I need few lines of nohup.out should be displayed on screen so that I will come to know the process is successfully started and continue with other options in my menu. Thanks in advance. (3 Replies)
Discussion started by: axes
3 Replies

6. Shell Programming and Scripting

extending the line length of nohup output

Hi I'm backgrounding matlab jobs using nohup. My foreground programs are written for an xterm that has 132 columns. When I use nohup and redirect the output to nohup.out, the default appears to be something like 72 columns, which breaks up my formatted screen output from matlab commands... (1 Reply)
Discussion started by: LeoSimon
1 Replies

7. UNIX for Dummies Questions & Answers

How to grep string from nohup.out file

Hi, I have one shell script, which run another one script inside in nohup mode. I want to search one string from the nohyup.out file in the same mail shell script itself .Can anyone help me?? Please find the code below: total_ear=`cd ear ; ls *.ear | wc -l | tr -d ' '` for ear in `cd ear ; ls... (0 Replies)
Discussion started by: ckchelladurai
0 Replies

8. Shell Programming and Scripting

grep from the nohup.out file

Hi, I have one shell script, which run another one script inside in nohup mode. I want to search one string from the nohup.out file in the same shell script itself .Can anyone help me?? Please find the code below: total_ear=`cd ear ; ls *.ear | wc -l | tr -d ' '` for ear in `cd ear ; ls... (1 Reply)
Discussion started by: ckchelladurai
1 Replies

9. UNIX for Dummies Questions & Answers

How do I send output of a background process to a file other than nohup.out?

I have a question. I will be running a background process using nohup and & command at end. I want to send output to a file say myprocess.out. So will this command work? nohup myprocess.ksh > myprocess.out & Thanks in advance guys !!! :) (3 Replies)
Discussion started by: vx04
3 Replies

10. Shell Programming and Scripting

Nohup not give expected output. Non-stop running process

Hello, I am trying to make a bash script, I tested nohup but it did not help me. My code is: ffmpeg -i $input_url -c:v copy -c:a copy -listen 1 -f mpegts http://localhost:port/live/test When I open it in VLC, it starts feeding my screen and I see bitrate values. When I stop watching it,... (4 Replies)
Discussion started by: baris35
4 Replies
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
All times are GMT -4. The time now is 08:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy