bug-bash
[Top][All Lists]
Advanced

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

Re: why does this define bla() instead of respect the newline as command


From: Alex fxmbsw7 Ratchev
Subject: Re: why does this define bla() instead of respect the newline as command separator
Date: Mon, 29 Mar 2021 18:04:51 +0200

case statements are imho string comparision, nothing to do with aliases

On Mon, Mar 29, 2021, 17:23 Chet Ramey <chet.ramey@case.edu> wrote:

> On 3/19/21 10:59 AM, Oğuz wrote:
>
> > Not much related, but isn't this supposed to work?
> >
> > $ cat foo.sh
> > alias c='case ' w='foo ' i='in ' p=') ' e='esac' u='uname ' s='; '
> > c w i e
>
> Bash is pretty careful not to perform alias expansion in case statement
> pattern lists, even to the point where that overrides the 'alias expand
> the next word because the previous expansion ended with a space'
> semantics.
>
> I could flip that, I suppose, even if the `use case' is this hypothetical
> example.
>
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
>                  ``Ars longa, vita brevis'' - Hippocrates
> Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/
>


reply via email to

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