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

Re: alias in bash script issue



On Sun, Mar 05, 2023 at 01:39:35AM +1100, David wrote:
> I am aware. 'man dash' better describes how aliases should be
> used in modern times,

???

Is this the paragraph you mean?

     Aliases provide a convenient way for naive users to create shorthands for
     commands without having to learn how to create functions with arguments.
     They can also be used to create lexically obscure code.  This use is dis‐
     couraged.

> 'man bash' avoids this clear language, which is unfortunate
> because that advice is what anyone who knows what they are
> doing will advise.

Do you mean this:

       For almost every purpose, aliases are superseded by shell functions.

Your statements are so incredibly vague that I can't tell what you're
trying to say.

In any case, the Subject: header still says "bash script", and in bash
scripts, aliases are disabled by default.  They have to be enabled
explicitly (shopt -s expand_aliases), before they can even be used.


Reply to: