Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15123

Re: alias problem -- conflict found

From L A Walsh <bash@tlinx.org>
Newsgroups gnu.bash.bug
Subject Re: alias problem -- conflict found
Date 2019-07-10 09:01 -0700
Message-ID <mailman.850.1562774534.2688.bug-bash@gnu.org> (permalink)
References (2 earlier) <5D23C417.5060108@tlinx.org> <20190709132112.GW2450@eeg.ccf.org> <10340.1562742284@jinx.noi.kre.to> <11760.1562772554@jinx.noi.kre.to> <5D260BD8.8010800@tlinx.org>

Show all headers | View raw



On 2019/07/10 08:29, Robert Elz wrote:
>
>   | Aliases are used internally by bash to store path lookups, by
>   | default.
>
> Really?   I haven't looked at any bash code in a very long time
> (for licensing reasons, I don't want to be corrupted by the GPL)
> but that sounds like a very weird way of implementing things if true.
>
>   | They are simply more efficient.  If functions were better, bash would
>   | implement path lookups by defining a function for each
>
> No it wouldn't, it would (probably actually does, since I can find
> nothing that indicates otherwise) keep a hash table with the results
> of path lookups.   Nothing related to aliases in any way at all.
>   
What do you think aliases are?  They are both a simple hash substitution.

env -i /bin/bash -c 'shopt -s expand_aliases;ls /tmp >&/dev/null;alias
ls=/bin/ls;declare -p BASH_CMDS BASH_ALIASES'          
declare -A BASH_CMDS=([ls]="/usr/bin/ls" )
declare -A BASH_ALIASES=([ls]="/bin/ls" )

Aliases are store/implemented using hashes the same as stored paths
are.  They are effectively the same.


Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: alias problem -- conflict found L A Walsh <bash@tlinx.org> - 2019-07-10 09:01 -0700

csiph-web