bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Redirection between assignment statement and command name prevents a


From: Chris F.A. Johnson
Subject: Re: Redirection between assignment statement and command name prevents alias substitution
Date: Thu, 25 Mar 2021 13:42:31 -0400 (EDT)
User-agent: Alpine 2.22 (DEB 394 2020-01-19)

On Thu, 25 Mar 2021, Oğuz wrote:

24 Mart 2021 Çarşamba tarihinde Robert Elz <kre@munnari.oz.au> yazdı:

    Date:        Wed, 24 Mar 2021 11:15:11 +0300
    From:        =?UTF-8?B?T8SfdXo=?= <oguzismailuysal@gmail.com>
    Message-ID:  <CAH7i3Lqg_H=nTJn3FiZ9PQ9eKWcx
K0pZmYz8_pNpLjtK4esSZw@mail.gmail.com>

  | I think I got the general idea of aliases now

I'm not sure why you want or need that, aliases
are dumb (bizarre) and shoukd be deleted...

I keep trying to get tge POSIX people to
remove them from the standard.  They keep ignoring me.  Shells won't drop
support, but at least
no-one woukd be able to rely on them working,
or working any particular way any more.


They are fine as an interactive feature but definitely don't belong in
shell scripts.

The only place I've ever used aliases is in a script:

alias show_command='[ $verbose -gt ${debuglevel:-0} ] && printf "%s" "++ $FUNCNAME " "${@/%/ 
}" && echo '

I couldn't use a function (which I do for all interactive uses) because that 
would change $FUNCNAME.


--
   Chris F.A. Johnson                         <http://cfajohnson.com/>
   =========================== Author: ===============================
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
   Pro Bash Programming: Scripting the GNU/Linux shell (2009, Apress)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]