Re: POSIX scripting tip
email@example.com (Philip Brown) writes:
> Miguel Wooding (firstname.lastname@example.org) wrote:
> > Philip Brown <email@example.com> wrote:
> > >
> > > If you have files
> > > fiftyfive fiftyfour fiftyone fiftysix fiftythree fiftytwo
> > > $ ls fifty?(one|f*)
> > > will result in
> > > fiftyfive fiftyfour fiftyone
> > [...]
> >It doesn't seem to have "sneaked in" at all. In bash:
> >$ touch ffive ffour fone fsix fthree ftwo
> >$ ls
> >ffive ffour fone fsix fthree ftwo
> >$ ls f?(one|f*)
> >bash: syntax error near unexpected token `f?(o'
> I specified that the above was a feature of **POSIX** sh.
> Bash is not a POSIX-compliant shell.
> [hence it is a Bad Thing that /bin/sh is a link to /bin/bash]
> (Mind you, I am guessing a bit that it in the actual POSIX spec.
> I know it's in the KSH spec, which mostly defines POSIX-sh, and
> under solaris supports ls f?(xxxxx) syntax.
> So it's a fairly well-founded guess ;-)
It doesn't work under ash either. Just another data point. Perhaps
it's time to look at the POSIX spec.
$ touch ffour fone fsix fthree ftwo
ffour fone fsix fthree ftwo
$ ls f?(one|f*)
Syntax error: "(" unexpected