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


Groups > gnu.bash.bug > #15110

Re: alias problem -- conflict found

Path csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
From Robert Elz <kre@munnari.OZ.AU>
Newsgroups gnu.bash.bug
Subject Re: alias problem -- conflict found
Date Wed, 10 Jul 2019 14:04:44 +0700
Lines 30
Approved bug-bash@gnu.org
Message-ID <mailman.783.1562742343.2688.bug-bash@gnu.org> (permalink)
References <5D255A6E.4060600@tlinx.org> <5D23C417.5060108@tlinx.org> <20190709132112.GW2450@eeg.ccf.org> <10340.1562742284@jinx.noi.kre.to>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Trace usenet.stanford.edu 1562742345 28422 209.51.188.17 (10 Jul 2019 07:05:45 GMT)
X-Complaints-To action@cs.stanford.edu
Cc bug-bash@gnu.org
To L A Walsh <bash@tlinx.org>
Envelope-to bug-bash@gnu.org
In-Reply-To <5D255A6E.4060600@tlinx.org>
X-detected-operating-system by eggs.gnu.org: Genre and OS details not recognized.
X-Received-From 2001:3c8:9009:181::2
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 <10340.1562742284@jinx.noi.kre.to>
X-Mailman-Original-References <5D255A6E.4060600@tlinx.org> <5D23C417.5060108@tlinx.org> <20190709132112.GW2450@eeg.ccf.org>
Xref csiph.com gnu.bash.bug:15110

Show key headers only | View raw


    Date:        Tue, 09 Jul 2019 20:24:30 -0700
    From:        L A Walsh <bash@tlinx.org>
    Message-ID:  <5D255A6E.4060600@tlinx.org>

  |     Why?  What makes clarity "horrible".

It isn't the clarity (if you call it that, it is really obscurity
as no-one else can read your scripts/commands and have any idea
what they really do) but the using of aliases that way to achieve it.

You could easily do what you want, much more effectively, and with
less disruption using functions instead ... with a function, the
conversion from "Export" to "-x" would only happen inside the "my"
function, so you would be able to just use "export" (and even allow
abbreviations) if you wanted - without it conflicting with "export"
used as a command.

Aliases are disgusting, and always have been - they remain really only
because POSIX says they should (because David Korn thought he needed
to copy that bit of csh which needed to do things this way because of
other limitations in the underlying implementation) - and because of
other dumb rules there are just a few things that functions cannot do,
which aliases can ... but in those cases the best solution is to write
a function with a different name (which is always the sole problem) and
then use an alias to make the name you want to use to the name that will
work for the function, and no more than that.

kre

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


Thread

Re: alias problem -- conflict found Robert Elz <kre@munnari.OZ.AU> - 2019-07-10 14:04 +0700

csiph-web