[Top][All Lists]

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

Re: empty command redirection

From: Alexandre Duret-Lutz
Subject: Re: empty command redirection
Date: Mon, 11 Oct 2004 16:27:39 +0200

On Mon, Oct 11, 2004 at 11:58:36AM +0200, Ralf Wildenhues wrote:
> * Paul Eggert wrote on Fri, Oct 08, 2004 at 03:58:11PM CEST:
> > Ralf Wildenhues <address@hidden> writes:
> >
> > > So far I've thought that
> > >   > file
> > > was a less portable way as
> > >   : > file
> > > to create an empty file.
> >
> > What gives you that impression?  I vaguely recall '> file' failing on
> > some ancient shells, but nowadays I don't know of any problems.
> To tell you the truth, I don't remember where I got that from, and I
> can't find any reference to it anymore.  Maybe that is just more
> cautious than necessary.

You have to be cautious outside autoconf, if you do not have the shell
initialization soap.

For instance Zsh handles `>foo' as `$NULLCMD >foo' where NULLCMD defaults
to `cat'.  With Zsh versions before 3.1.6-dev-18 you had to set `NULLCMD=:'
so your script behave properly.  With later versions `emulate sh' is enough.
Autoconf does both anyway.

reply via email to

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