[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bash 3.2.39 -- race condition
From: |
Eric Blake |
Subject: |
Re: bash 3.2.39 -- race condition |
Date: |
Mon, 30 Nov 2009 05:58:13 -0700 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Marc Herbert on 11/30/2009 3:18 AM:
> A long time ago I read somewhere that aliases are not recommended. I
> think they do not bring anything on the table compared to functions, do
> they?
There is one thing that aliases can do that functions cannot - and that is
control how the rest of the statement is parsed. This can be exploited to
write an alias for find that calls a function with globbing temporarily
turned off for the rest of the statement; the function then restores
globbing state after executing the real find under the hood.
http://www.chiark.greenend.org.uk/~sgtatham/aliases.html
But yes, other than cool hacks like that, functions are almost always
hands down more powerful than aliases.
- --
Don't work too hard, make some time for fun as well!
Eric Blake ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAksTwWUACgkQ84KuGfSFAYAhdwCcCO7fGXLSu9QYODSr/lsK765Y
kOcAoMnj6ZKikCBKRDlC6dCluycSWaQ2
=kfKZ
-----END PGP SIGNATURE-----