[Top][All Lists]

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

Re: spaces in $0

From: Stepan Kasal
Subject: Re: spaces in $0
Date: Fri, 31 Mar 2006 16:44:23 +0200
User-agent: Mutt/1.4.1i


On Mon, Mar 27, 2006 at 07:42:35PM +0200, Ralf Wildenhues wrote:
> * Ralf Wildenhues wrote on Mon, Mar 20, 2006 at 08:29:48PM CET:
> > $ foo='bar  baz'
> > $ touch "$foo"
> > $ cat <$foo
> > bash: $foo: ambiguous redirect
> D'oh.  Teaches me right to check the standard (which does explicitly
> distinguish interactive and non-interactive behavior here).

well, that's the standard.  (This behaviour is allowed for interactive
shells but not non-interactive.)

But in practice, all normal shell don't word split redirections.

Bash is probably the only one which performs word splitting, only to
cry an error if more than one word is found.  (Only bash kiddies like
I or you could think this is a standard behaviour.  ;-)

With bash, this is switched off by `set -o posix'; moreover, if you call
it as `sh', this option is on by default.  (It doesn't matter whether
the shell is interactive or non-interactive.)

So when the changes like

> > > > -  ' <$as_myself |
> > > > +  ' <"$as_myself" |

really are not needed, because this code is in the M4SH-INIT diversion,
after the SANITIZE diversion, so the `set -o posix' has already been run.

Have a nice day,

reply via email to

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