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


Groups > gnu.bash.bug > #15154

Re: alias problem -- conflict found

Path csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail
From Dennis Williamson <dennistwilliamson@gmail.com>
Newsgroups gnu.bash.bug
Subject Re: alias problem -- conflict found
Date Fri, 12 Jul 2019 16:43:48 -0500
Lines 62
Approved bug-bash@gnu.org
Message-ID <mailman.1068.1562967848.2688.bug-bash@gnu.org> (permalink)
References <5D26A322.109@tlinx.org> <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> <480d3363-dce0-6629-b1f6-bca0b006cc88@case.edu> <9139.1562820381@jinx.noi.kre.to> <5D28C1CA.3000002@tlinx.org> <d59b3149-c458-84df-99ab-96bc4bbbce3d@archlinux.org> <5D28F1A5.6090200@tlinx.org> <CANaoh6KusmpUqc-C-=7BBm0fTMNN2=HvfJaBjay4OyxcWavRGg@mail.gmail.com>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset="UTF-8"
X-Trace usenet.stanford.edu 1562967848 17012 209.51.188.17 (12 Jul 2019 21:44:08 GMT)
X-Complaints-To action@cs.stanford.edu
Cc Eli Schwartz <eschwartz@archlinux.org>, bug-bash <bug-bash@gnu.org>
To Linda Walsh <bash@tlinx.org>
Envelope-to bug-bash@gnu.org
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Aa7lNo156jYSpz7bJ4eE2PayxUqvJ0f3cQfDuwJbrn4=; b=SZtrXeNd/mkhD/VxcIi/G9JlZFm0qLgiL1zXN62S4sryBE5aN6iWv7JZjM9JT2w7jK fpSanCTJfnQMrrWcFCWs91HxOPaTeiNEkktZaWiDGpwTJkoo0227Q5XsyFuSjk3OEfaX LS39hTFkv1nooSzDiEhCTA4zJ3yzNvsw+pzR8Ls/VPikAFoGe9WxuhQTa0RjLNgC+xLK GnlasFSnvxEm0/NbXwf6X3mja4UHxpsaOYuY9HyGAySDZCZBsf7Het18B5rMdAKuLVtm SdaUxHoPGg3646oC2WtBv4ynhp879kvryGUN4uDRXT4vuKVrLOvFT5MD0TmF2WlNoymN 7TLQ==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Aa7lNo156jYSpz7bJ4eE2PayxUqvJ0f3cQfDuwJbrn4=; b=uZfrir8OLr1GR4mYaRWU6Aop4/YFiWYdfXtfGVJZXOct1yCRiBTjKv+bGPK3NL1gLb VTKLG3ZaLbGCWd4iRBjVgwmMYzX6gHosCIJ8fm/VR8Qw6u2orV4ZWw7IDn+5Q64AsWIW 7yVIfAu7WbO8NWUGmuFvjU7VLWxk0zaphEZMGD2M31zSXXPiYB21PimSNtyG0AHHZKLd t6yaj8ylF+IgKiwAHP6ewMUrZc5n7jHeI9dKAAQH4qkZfZnu5GJr38ufHwQZ0vBiAkBH ayeELbJ3KwBFye0TxQQBAbulMgQ6x+HkHwDBm1eF2QwaWhQMd2xka3A9JXE+6RBYkFKx dJVQ==
X-Gm-Message-State APjAAAXc5lcznbYloYALHO8R889q8LDBq3xI2V7MYdv/oJNhVy2C9C5D xm5pRTcoo8XHLQqZ1yiHm5gNorkzdtJvltlthg==
X-Google-Smtp-Source APXvYqzXo2CjTBtpiICsXQHcrUnTi8ZTFj82p5wXLWylDJT8yJEdkMCsnMh0wg5xyTrg1D2MEN1SuV5SThKcokVGGR4=
X-Received by 2002:a1c:2314:: with SMTP id j20mr11179172wmj.152.1562967840057; Fri, 12 Jul 2019 14:44:00 -0700 (PDT)
In-Reply-To <5D28F1A5.6090200@tlinx.org>
X-detected-operating-system by eggs.gnu.org: Genre and OS details not recognized.
X-Received-From 2a00:1450:4864:20::32a
X-Content-Filtered-By Mailman/MimeDel 2.1.23
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 <CANaoh6KusmpUqc-C-=7BBm0fTMNN2=HvfJaBjay4OyxcWavRGg@mail.gmail.com>
X-Mailman-Original-References <5D26A322.109@tlinx.org> <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> <480d3363-dce0-6629-b1f6-bca0b006cc88@case.edu> <9139.1562820381@jinx.noi.kre.to> <5D28C1CA.3000002@tlinx.org> <d59b3149-c458-84df-99ab-96bc4bbbce3d@archlinux.org> <5D28F1A5.6090200@tlinx.org>
Xref csiph.com gnu.bash.bug:15154

Show key headers only | View raw


On Fri, Jul 12, 2019, 3:46 PM L A Walsh <bash@tlinx.org> wrote:

> On 2019/07/12 11:51, Eli Schwartz wrote:
>
>
> find_cmds() {
>   for c in "$@"; do
>     type -P $c >&/dev/null || {
>       Pe "$0#$LINENO: Cannot find %s", "$c"
>       exit 1; }
>     alias $c=$(type -P $c);
>   done
> }
>
>
>

This is a perfect example. I have to guess what Pe is. I presume it means
Print_error. If so, that's what it should be named - for readability. And
instead of assuming that it's a function, I have to hope it's not an alias.
By the way, why isn't type -p aliases to Pathof or something?

<snip>

>
>     You claim that my saying the bash-builtins are a type of alias for an
> external command that it is intended to have some similar functionality
> to, is
> "nonsense".  To  that assertion, I used the fact that many or most bash
> builtins that replace external counterparts are also following some
> POSIX stated behavior to support my original assertion that they are
> intended to be drop-in
> replacements for those commands.  I.e. using the design requirements for
> those bash built-ins that replace external posix components, its easy to
> see
> that your nonsensical response of 'Nonsense' was incorrect.  Talking about
> different methods of saying the same thing, like aliasing is about as on
> topic as anything.
>
>


Baby Face Nelson is an alias for Lester Joseph Gillis. John Dillinger was a
contemporaneous bank robber but he was not an alias for Mr. Gillis (but
they did partner at one point). Perhaps Pretty Boy Floyd would make a
better example though since his nickname bears a similarity to Gillis'.

But I digress.

<snip>

Ultimately one of the facts at issue is that Bash is both a scripting
language and a command line interface. As the latter, it includes a number
of command line conveniences that should not be used in scripts. Among
those, in my opinion, are aliases and tilde expansions. I would also
include the overuse of pipes. Of course they are fundamental to the Unix
way and hacking something together on a command line for a one off or while
feeling one's way toward a solution is fine. I'd better not see a script
containing grep piped into awk

As far as saving keystrokes while typing goes, any good editor can be a
great deal of help in this pursuit.

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


Thread

Re: alias problem -- conflict found Dennis Williamson <dennistwilliamson@gmail.com> - 2019-07-12 16:43 -0500

csiph-web