[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
aliases not supported by default in non-interactive mode...but POSIX req
L A Walsh
aliases not supported by default in non-interactive mode...but POSIX required?
Thu, 24 Aug 2017 18:49:08 -0700
I was directed to the POSIX section on aliases and it doesn't
say they are only to be enabled during interactive mode, but
seem to be a required compatibility feature even when running
2.3.1 Alias Substitution
of aliases shall be supported on all XSI-conformant systems or if the
system supports the User Portability Utilities option (and the rest of
this section is not further marked for these options). [Option End]
After a token has been delimited, but before applying the grammatical
rules in Shell Grammar
, a resulting word that is identified to be the command name word of a
simple command shall be examined to determine whether it is an unquoted,
valid alias name. However, reserved words in correct grammatical context
shall not be candidates for alias substitution. A valid alias name (see
the Base Definitions volume of IEEE Std 1003.1-2001, Section 3.10, Alias
shall be one that has been defined by the /alias/
utility and not subsequently undefined using /unalias/
Implementations also may provide predefined valid aliases that are in
effect when the shell is invoked. To prevent infinite loops in recursive
aliasing, if the shell is not currently processing an alias of the same
name, the word shall be replaced by the value of the alias; otherwise,
it shall not be replaced.
However, in testing posix and non-posix modes in bash 4.4.12, I don't
see aliases being enabled in scripts.
To be POSIX conformant, wouldn't they have to be on?
Why do some people say aliases shouldn't be used, when they are
POSIX required for compatibility?
- aliases not supported by default in non-interactive mode...but POSIX required?,
L A Walsh <=