hi, I do not think it is a bug; jobs.c:
1607 /* We need to add a CR only if this is an interactive shell, and 1608 we're reporting the status of a completed job asynchronously. 1609 We can't really check whether this particular job is being 1610 reported asynchronously, so just add the CR if the shell is 1611 currently interactive and asynchronous notification is enabled. */ 1612 if (asynchronous_notification && interactive) 1613 fprintf (stream, "\r\n"); 1614 else 1615 fprintf (stream, "\n"); cheers, pg On Thu, Nov 13, 2014 at 8:21 PM, <idal...@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). > > Repeat-By: > > $ sleep 999 & > [1] 16386 > $ set +o notify > $ jobs >out > $ file out > out: ASCII text > $ set -o notify > $ jobs >out > $ file out > out: ASCII text, with CRLF line terminators > $ od -c out > 0000000 [ 1 ] + R u n n i n g > 0000020 s l > 0000040 e e p 9 9 9 & \r \n > 0000053 > $ jobs | od -c > 0000000 [ 1 ] + R u n n i n g > 0000020 s l > 0000040 e e p 9 9 9 & \n > 0000052 > >