From 60f3c362f51500cc6e9b5dbcd5ff4dfd3fcd914e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 28 Apr 2007 20:47:29 +0200 Subject: * src/nohup.c (usage): Describe how standard input and output are redirected. --- ChangeLog | 5 +++++ doc/ChangeLog | 5 +++++ doc/coreutils.texi | 8 ++++++++ lib/.cvsignore | 4 ++++ lib/.gitignore | 4 ++++ src/nohup.c | 7 +++++++ 6 files changed, 33 insertions(+) diff --git a/ChangeLog b/ChangeLog index a6202129b..3149e4971 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-04-28 Paul Eggert + + * src/nohup.c (usage): Describe how standard input and output + are redirected. + 2007-04-25 Jim Meyering * src/du.c (usage): Clarify description of --dereference-args (-D). diff --git a/doc/ChangeLog b/doc/ChangeLog index ca00a842d..80d2f0971 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2007-04-28 Paul Eggert + + * coreutils.texi (nohup invocation): Add advice about saving + output to a file. + 2007-04-16 Jim Meyering * coreutils.texi (cut invocation): Adjust synopsis to show that an diff --git a/doc/coreutils.texi b/doc/coreutils.texi index e1c5f5172..c535dad58 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 +@command{make}: + +@example +nohup make > make.log +@end 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/lib/.cvsignore b/lib/.cvsignore index 578c0c28e..3fd4bb79b 100644 --- a/lib/.cvsignore +++ b/lib/.cvsignore @@ -358,6 +358,10 @@ strtoumax.c strverscmp.c strverscmp.h sys +sys_socket.h +sys_socket_.h +sys_stat.h +sys_stat_.h sys_time.h sys_time_.h t-fpending diff --git a/lib/.gitignore b/lib/.gitignore index 8e1e579fe..3139b9363 100644 --- a/lib/.gitignore +++ b/lib/.gitignore @@ -349,6 +349,10 @@ strtoumax.c strverscmp.c strverscmp.h sys +sys_socket.h +sys_socket_.h +sys_stat.h +sys_stat_.h sys_time.h sys_time_.h t-fpending diff --git a/src/nohup.c b/src/nohup.c index dd64410b3..aeab291c3 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); printf (USAGE_BUILTIN_WARNING, PROGRAM_NAME); emit_bug_reporting_address (); } -- cgit v1.2.3-54-g00ecf