On 2/3/22 12:05 PM, L A Walsh wrote:

    There's no need for it, it just makes your script harder to
    follow.
---
    I write scripts for myself.  aliases make scriptes easier to create
modify and maintain.  You can type 'declare -i x=1', I prefer 'int x=1' I find 'declare -xxyz' harder to write, read and parse than 'my', 'array' 'map'

This is, as you say, a personal preference for private scripts. You're free
to advocate for that style, but don't expect other people to see its
advantages.

We aren't talking 100 aliases, but these:
alias my='declare ' int='my -i ' array='my -a ' map='my -A '

are used in nearly all my scripts.

OK. Does the number of aliases really matter?

There is no way you can tell me that:
declare var='v'
declare -i ivar=1

are more clear than:

my var='v'
int ivar=1

This is, again, a personal preference. The former has the advantage of
being documented.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/

Reply via email to