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


Groups > gnu.bash.bug > #15123 > unrolled thread

Re: alias problem -- conflict found

Started byL A Walsh <bash@tlinx.org>
First post2019-07-10 09:01 -0700
Last post2019-07-10 09:01 -0700
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#15123 — Re: alias problem -- conflict found

FromL A Walsh <bash@tlinx.org>
Date2019-07-10 09:01 -0700
SubjectRe: alias problem -- conflict found
Message-ID<mailman.850.1562774534.2688.bug-bash@gnu.org>

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.


[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web