On Sep 27, 3:46pm, Clint Adams wrote:
} Subject: two append bugs?
}
} % chmod 0 t
}
} % echo bla >> t || echo failed
} zsh: permission denied: t
}
} % /bin/echo bla >> t || echo failed
} zsh: permission denied: t
} failed
}
} This happens with other builtins as well. I assume that this inconsistency
} is the first bug.
It's not exactly a bug. In neither case does zsh execute the "echo"; it
just happens that in the case of the external command, it forks before it
attempts to open the file for redirection. (It has nothing to do with
whether or not the redirect is an append, so it's not an "append bug".)
It might be possible to get zsh to behave "as if" it had forked in this
circumstance.
} Now, on an NFS read-only mount, I get:
}
} zsh: no such file or directory: t
}
} whereas 3.0.7 more accurately responds
}
} zsh: read-only file system: t
}
} which I assume to be the other bug.
This isn't a bug either; it depends on the setting of the CLOBBER option.
You'll get "no such file" if you attempt to append-without-create, and
"read-only file system" if you attempt to append-with-create. This is
true in both 3.0.[78] and 3.1.9; watch what happens when you do
/bin/echo bla >>| t
to force append-with-create. Conversely, try just ">>" on a nonexistent
name with "unsetopt CLOBBER" in effect, even on a writable file system.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/bartshttp://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net