[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: |
Chet Ramey |
Subject: |
Re: why does this define bla() instead of respect the newline as command separator |
Date: |
Mon, 29 Mar 2021 11:23:04 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 |
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/