[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
Alex fxmbsw7 Ratchev
Re: why does this define bla() instead of respect the newline as command separator
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 <firstname.lastname@example.org> 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'
> I could flip that, I suppose, even if the `use case' is this hypothetical
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
> ``Ars longa, vita brevis'' - Hippocrates
> Chet Ramey, UTech, CWRU email@example.com http://tiswww.cwru.edu/~chet/