[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Running case commands with the shell function?
From: |
David Boyce |
Subject: |
Re: Running case commands with the shell function? |
Date: |
Thu, 14 Sep 2017 10:48:53 -0700 |
I was working from memory there. It's at *least* true of bash and ksh, and
the POSIX shell was based on ksh originally so I'd have expected it to be
in POSIX too. But I don't see it in dash which was intended to be a
bare-bones POSIX shell so it looks like I was wrong about POSIX.
David
On Thu, Sep 14, 2017 at 10:22 AM, Quinn Grier <address@hidden> wrote:
> On 2017-09-14 05:54, David Boyce wrote:
> > At one time "case" was necessary with
> > patterns because "if" didn't handle them, but in the POSIX shell they
> take
> > the same pattern constructs so you could say "if [[ $$target = i386-*-
> ]];
> > then ... else ... fi".
>
> Is this true? I can only find POSIX saying otherwise:
>
> The following words may be recognized as reserved words on
> some implementations (when none of the characters are quoted),
> causing unspecified results:
>
> [[ ]] function select
>
>
Re: Running case commands with the shell function?, Rakesh Sharma, 2017/09/16