Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Why do I get a "bad filedescriptor" here? (redirection problem)



zsh 4.0.7

$ ls >& -
/bin/ls: write error: Bad file descriptor
$ cat >&- <<<d
cat: standard output: Bad file descriptor
$ ls >/dev/null
$ echo x >& -
$ 

Why do I get a "bad file descriptor" in the first two cases?
Note that closing stdout with echo works fine, as does
(of course) redirection of ls output to the bit bucket.

And in case this matters:

$ type ls
ls is an alias for /bin/ls --almost-all --color --classify
$ type cat
cat is /bin/cat

Ronald
-- 
Ronald Fischer (phone +49-89-63676431)
mailto:mn-pg-p-e-b-consultant-3.com@xxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author