[Top][All Lists]

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

Shell redirection success/failure isn't checked

From: Jeff Connelly
Subject: Shell redirection success/failure isn't checked
Date: Fri, 27 Aug 2004 23:28:44 -0700

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. -I./include -I./lib   -O2 -pipe
uname output: Linux amd64 2.6.7-gentoo-r8 #2 Sun Jul 4 22:41:50 PDT
2004 x86_64 4  GNU/Linux
Machine Type: x86_64-pc-linux-gnu

Bash Version: 3.0
Patch Level: 0
Release Status: release

        I'm using:

        GNU bash, version 3.00.0(1)-release (x86_64-pc-linux-gnu)
        Copyright (C) 2004 Free Software Foundation, Inc.

        and bash doesn't check if shell redirection was successful. I came
        across this problem when my hard drive became full. Redirections
        wouldn't return any error, but the redirected file would be empty.
        Certainly bash should report any errors that occur doing stream

        For comparison, this is what happens in a shell which will remain

        % echo foo>bar
        echo: write error: no space left on device

On a related note:
bash-3.00$ ulimit -f 0
bash-3.00$ echo foo>bar
File size limit exceeded
(logs out)

I'm not sure if this is a bug. Does it occur because bash tries to open the cwd?
Not logging the user out would be the preferable behavior.

-Jeff Connelly

        bash-3.00$ dd if=/dev/zero of=junk
        dd: writing to `junk': No space left on device
        276353+0 records in
        276352+0 records out
        bash-3.00$ echo foo>bar
        bash-3.00$ cat bar

        Should be a simple case of checking return value of fopen().

reply via email to

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