[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

better nohup documentation for I/O redirection

From: Paul Eggert
Subject: better nohup documentation for I/O redirection
Date: Sat, 28 Apr 2007 11:40:32 -0700
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

Like Jim, I'm not sold about adding an option to nohup when simple I/O
redirection already works.  However, I think it'd be nice to document
the I/O redirection.  Here's a proposed patch.

* src/nohup.c (usage): Describe how standard input and output
are redirected.
* coreutils.texi (nohup invocation): Add advice about saving
output to a file.
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index e1c5f51..c535dad 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -13441,6 +13441,14 @@ However, if standard output is closed, standard error 
terminal output
 is instead appended to the file @file{nohup.out} or
 @file{$HOME/nohup.out} as above.

+To capture the command's output to a file other than @file{nohup.out}
+you can redirect it.  For example, to capture the output of
+nohup make > make.log
address@hidden example
 @command{nohup} does not automatically put the command it runs in the
 background; you must do that explicitly, by ending the command line
 with an @samp{&}.  Also, @command{nohup} does not alter the
diff --git a/src/nohup.c b/src/nohup.c
index dd64410..aeab291 100644
--- a/src/nohup.c
+++ b/src/nohup.c
@@ -66,6 +66,13 @@ Run COMMAND, ignoring hangup signals.\n\
 "), stdout);
       fputs (HELP_OPTION_DESCRIPTION, stdout);
       fputs (VERSION_OPTION_DESCRIPTION, stdout);
+      printf (_("\n\
+If standard input is a terminal, redirect it from /dev/null.\n\
+If standard output is a terminal, append output to `nohup.out' if possible,\n\
+`$HOME/nohup.out' otherwise.\n\
+If standard error is a terminal, redirect it to standard output.\n\
+To save output to FILE, use `%s COMMAND > FILE'.\n"),
+             program_name);
       emit_bug_reporting_address ();
M ChangeLog
M doc/ChangeLog
M doc/coreutils.texi
M src/nohup.c
Committed as 3a80a6577828960d237d5ad146eecae984519eee

reply via email to

[Prev in Thread] Current Thread [Next in Thread]