Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #15154
| From | Dennis Williamson <dennistwilliamson@gmail.com> |
|---|---|
| Newsgroups | gnu.bash.bug |
| Subject | Re: alias problem -- conflict found |
| Date | 2019-07-12 16:43 -0500 |
| Message-ID | <mailman.1068.1562967848.2688.bug-bash@gnu.org> (permalink) |
| References | (9 earlier) <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> |
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
Re: alias problem -- conflict found Dennis Williamson <dennistwilliamson@gmail.com> - 2019-07-12 16:43 -0500
csiph-web