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

Bug#818: echo builtin doesn't check for write errors



Buddha M. D. Buck writes ("Bug#818: echo builtin doesn't check for write errors"):
> As of 1.14.6-4, this bug is still there... maybe
> 
> $ type echo
> echo is a shell builtin
> $ echo foo >/dev/full
> $ echo $?
> 0
> $ cat /dev/zero >/dev/full
> cat: write error: No space left on device
> $ echo $?
> 1
> $ /bin/echo foo >/dev/full
> $ echo $?
> 0
> $ file /bin/echo    
> /bin/echo: ELF 32-bit LSB executable, Intel 80386, version 1, stripped
> $ 
> 
> The built-in version of echo is faithfull reproducing what the
> binary version does.  
> 
> If they are both in error, should another bug be filed for
> shellutils?  The manpage for echo makes no mention whatsoever
> of return values.

There are already bug reports against shellutils and tcsh too.

All programs should check for write errors.  The fact that the
documentation neglects to say that it does doesn't mean it is OK for
it not to bother.

Ian.



Reply to: