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

Re: bash command incompatibility



On Wed, Jul 28, 2004 at 11:07:34AM +0300, Petre Bandac wrote:
> [petre@xxl]$ cat /dev/null > fetchmail.log                              

As an alternative to turning off the no_clobber option (as Peter
suggested), you can just tell zsh that you know that the file already
exists by using a '|' after the '>', like this:

    cat /dev/null >|fetchmail.log

If you enable the option hist_allow_clobber, then any time you get a
"file exists" error, you can just recall the command from the history
and press Enter because the '|' will have been added for you.

Finally, you can avoid the problem all together by using cp:

    cp /dev/null fetchmail.log

That works in any shell and is easier to type.

..wayne..



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