[Top][All Lists]

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

Re: set -o notify spurious CR when jobs redirected to file

From: Chet Ramey
Subject: Re: set -o notify spurious CR when jobs redirected to file
Date: Fri, 14 Nov 2014 10:30:12 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

On 11/13/14, 2:21 PM, idallen@idallen.ca wrote:
> Configuration Information [Automatically generated, do not change]:
> Machine: x86_64
> OS: linux-gnu
> Compiler: gcc
> Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' 
> -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' 
> -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
> -DHAVE_CONFIG_H   -I.  -I../bash -I../bash/include -I../bash/lib  
> -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 
> -Wformat -Wformat-security -Werror=format-security -Wall
> uname output: Linux idallen-oak.home.idallen.ca 3.13.0-40-generic 
> #68~precise1-Ubuntu SMP Tue Nov 4 16:00:24 UTC 2014 x86_64 x86_64 x86_64 
> GNU/Linux
> Machine Type: x86_64-pc-linux-gnu
> Bash Version: 4.2
> Patch Level: 25
> Release Status: release
> Description:
>     Using "set -o notify" adds spurious CR to output of "jobs"
>     when output is redirected to a file (but not into a pipe).

Yes, it's intended.  Piotr identified the code that does this.  If the
shell is currently interactive, it can't be sure under what circumstances
it's printing a job notification.  If it's doing asynchronous notification,
it puts the \r in there to make the output look better.  A process in a
pipeline is not currently interactive, so bash doesn't do that in the
second case.

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/

reply via email to

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