bug-bash
[Top][All Lists]
Advanced

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

[PATCH] silent job monitor when 'set +m'


From: Jeff Chua
Subject: [PATCH] silent job monitor when 'set +m'
Date: Sat, 7 Nov 2009 18:27:32 +0800 (SGT)


Chet,

The man page mentioned that 'set -m' should print 'a line containing their status upon their completion' ... which should imply 'set +m' should NOT print the status.

Attached is a patch to 'silent' bash so that it won't print the status when 'Monitor mode' is off (set +m).

If this is not the right place to do this, please suggest an alternative to silent bash when 'kill %!' is executed.


Thanks,
Jeff


--- bash/jobs.c.org     2009-11-06 20:26:13.000000000 +0800
+++ bash/jobs.c 2009-11-06 23:55:17.000000000 +0800
@@ -3489,8 +3489,12 @@
                  signal_is_trapped (termsig) == 0)
                {
                  /* Don't print `0' for a line number. */
-                 fprintf (stderr, _("%s: line %d: "), get_name_for_error (), 
(line_number == 0) ? 1 : line_number);
-                 pretty_print_job (job, JLIST_NONINTERACTIVE, stderr);
+                 if(job_control) {
+                         fprintf (stderr, _("%s: line %d: "),
+                               get_name_for_error (),
+                               (line_number == 0) ? 1 : line_number);
+                         pretty_print_job (job, JLIST_NONINTERACTIVE, stderr);
+                 }
                }
              else if (IS_FOREGROUND (job))
                {




reply via email to

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