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


Groups > linux.debian.user > #255664

Re: alias in bash script issue

From David Wright <deblis@lionunicorn.co.uk>
Newsgroups linux.debian.user
Subject Re: alias in bash script issue
Date 2023-03-07 03:50 +0100
Message-ID <G6vyN-aFLo-1@gated-at.bofh.it> (permalink)
References (1 earlier) <G5wQh-9ZrY-1@gated-at.bofh.it> <G5DI5-a3Xs-5@gated-at.bofh.it> <G5DRL-a41h-5@gated-at.bofh.it> <G63jb-amPC-7@gated-at.bofh.it> <G64ff-anAR-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun 05 Mar 2023 at 16:30:10 (-0500), Greg Wooledge wrote:
> On Sun, Mar 05, 2023 at 02:37:48PM -0600, David Wright wrote:
> > There are many lists of dangerous aliases on the web, but I haven't
> > found a list of such aliases that can't be transcribed into functions.
> 
> Here's one document:
> 
> https://www.chiark.greenend.org.uk/~sgtatham/aliases.html

An enjoyable article, thanks. A nice illustration of
Cambridge computer scientists' ingenuity.

But it clearly has no connection with my criticism of man dash.
So, you can combine a carefully crafted pairing of alias and
function (a "magic alias") to achieve an effect that's not
possible using either one or the other. That's not the naive
user who hasn't learned how to create functions with arguments.
Nor are the contructions /lexically/ obscure; the trap is
rather in the evaluation's occurring in an unexpected context.
Just how dangerous that will be is moot.

My impression is that the most dangerous frequently used
aliases are those that redefine commands perceived as unsafe;
a prime example being rm → rm -i.

Cheers,
David.

Back to linux.debian.user | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

alias in bash script issue Ken Young <ken@highwinds.cloud> - 2023-03-04 09:40 +0100
  Re: alias in bash script issue David <bouncingcats@gmail.com> - 2023-03-04 11:00 +0100
    Re: alias in bash script issue Tom Furie <tom@furie.org.uk> - 2023-03-04 14:20 +0100
      Re: alias in bash script issue David <bouncingcats@gmail.com> - 2023-03-04 15:50 +0100
        Re: alias in bash script issue Greg Wooledge <greg@wooledge.org> - 2023-03-04 17:30 +0100
    Re: alias in bash script issue David Wright <deblis@lionunicorn.co.uk> - 2023-03-04 18:20 +0100
      Re: alias in bash script issue Greg Wooledge <greg@wooledge.org> - 2023-03-04 18:30 +0100
        Re: alias in bash script issue David Wright <deblis@lionunicorn.co.uk> - 2023-03-05 21:40 +0100
          Re: alias in bash script issue Greg Wooledge <greg@wooledge.org> - 2023-03-05 22:40 +0100
            Re: alias in bash script issue David Wright <deblis@lionunicorn.co.uk> - 2023-03-07 03:50 +0100
    Re: alias in bash script issue Ken Young <ken@highwinds.cloud> - 2023-03-05 02:30 +0100
      Re: alias in bash script issue Greg Wooledge <greg@wooledge.org> - 2023-03-05 02:40 +0100
        Re: alias in bash script issue Tom Browder <tom.browder@gmail.com> - 2023-03-05 12:30 +0100
          Re: alias in bash script issue Ken Young <ken@highwinds.cloud> - 2023-03-05 12:40 +0100
            Re: alias in bash script issue Tom Browder <tom.browder@gmail.com> - 2023-03-05 12:50 +0100
              Re: alias in bash script issue Nicolas George <george@nsup.org> - 2023-03-05 14:30 +0100
                Re: alias in bash script issue <tomas@tuxteam.de> - 2023-03-05 17:10 +0100
                Re: alias in bash script issue Tom Browder <tom.browder@gmail.com> - 2023-03-07 13:10 +0100
            Re: alias in bash script issue <tomas@tuxteam.de> - 2023-03-05 14:10 +0100
  Re: alias in bash script issue Yassine Chaouche <a.chaouche@algerian-radio.dz> - 2023-03-06 11:10 +0100

csiph-web