[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
aliases not supported by default in non-interactive mode...but POSIX req
From: |
L A Walsh |
Subject: |
aliases not supported by default in non-interactive mode...but POSIX required? |
Date: |
Thu, 24 Aug 2017 18:49:08 -0700 |
User-agent: |
Thunderbird |
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
non-interactively:
=====
2.3.1 Alias Substitution
^[UP XSI <javascript:open_code('UP XSI')>] [Option Start] The processing
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
<http://pubs.opengroup.org/onlinepubs/007904975/utilities/xcu_chap02.html#tag_02_10>
, 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
Name
<http://pubs.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap03.html#tag_03_10>)
shall be one that has been defined by the /alias/
<http://pubs.opengroup.org/onlinepubs/007904975/utilities/alias.html>
utility and not subsequently undefined using /unalias/
<http://pubs.opengroup.org/onlinepubs/007904975/utilities/unalias.html>.
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 <=