You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
\foo for alias suppression is POSIX-compliant (as are 'foo' and "foo"), from what I can tell (see below). dash, probably the strictest implementation of the POSIX shell spec, accepts it.
Note that even though alias expansion in scripts (non-interactive shells) is disabled by default, the mechanism is still needed on occasion, such as when writing functions that are sourced for interactive use.
command foo is not a substitute for \foo, because, unlike \foo, it also bypasses shell functions - see the command POSIX spec.
As for why \foo to suppress alias expansion of foois POSIX-compliant:
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.
Note that quote removal has NOT yet happened at this stage, so, if the alias name is foo, \foo is clearly not the same.
The text was updated successfully, but these errors were encountered:
For bugs
I know that there are preexisting, closed issues (#552, #485, #188), but I think the issue is worth revisiting.
Unlike what the wiki entry states:
\foo
for alias suppression is POSIX-compliant (as are'foo'
and"foo"
), from what I can tell (see below).dash
, probably the strictest implementation of the POSIX shell spec, accepts it.command foo
is not a substitute for\foo
, because, unlike\foo
, it also bypasses shell functions - see thecommand
POSIX spec.As for why
\foo
to suppress alias expansion offoo
is POSIX-compliant:2.3.1 Alias Substitution states (emphasis added):
Note that quote removal has NOT yet happened at this stage, so, if the alias name is
foo
,\foo
is clearly not the same.The text was updated successfully, but these errors were encountered: