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


Groups > gnu.bash.bug > #15123

Re: alias problem -- conflict found

Path csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
From L A Walsh <bash@tlinx.org>
Newsgroups gnu.bash.bug
Subject Re: alias problem -- conflict found
Date Wed, 10 Jul 2019 09:01:28 -0700
Lines 30
Approved bug-bash@gnu.org
Message-ID <mailman.850.1562774534.2688.bug-bash@gnu.org> (permalink)
References <5D25D398.7010300@tlinx.org> <5D255A6E.4060600@tlinx.org> <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>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 7bit
X-Trace usenet.stanford.edu 1562774534 13027 209.51.188.17 (10 Jul 2019 16:02:14 GMT)
X-Complaints-To action@cs.stanford.edu
Cc bug-bash@gnu.org
To Robert Elz <kre@munnari.OZ.AU>
Envelope-to bug-bash@gnu.org
User-Agent Thunderbird
In-Reply-To <11760.1562772554@jinx.noi.kre.to>
X-detected-operating-system by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic]
X-Received-From 173.164.175.65
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <5D260BD8.8010800@tlinx.org>
X-Mailman-Original-References <5D25D398.7010300@tlinx.org> <5D255A6E.4060600@tlinx.org> <5D23C417.5060108@tlinx.org> <20190709132112.GW2450@eeg.ccf.org> <10340.1562742284@jinx.noi.kre.to> <11760.1562772554@jinx.noi.kre.to>
Xref csiph.com gnu.bash.bug:15123

Show key headers only | 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