On Sun, May 18, 2008 at 6:33 PM, Geoffroy Carrier <geoffroy.carrier@koon.fr> wrote:
Excerpts from Aaron Griffin's message of Sun May 18 23:43:42 +0200 2008:
that would be totally illogical. the point of using ${foo} instead of $foo is that in some cases you really need ${foo}:
source=($pkgname_$pkgver) won't work, but source=(${pkgname}_$pkgver) will. (just an example but probably you got the point). because of this, some projects (like gentoo) force the usage of ${foo} everywhere.
OT: I also enforce it in mkinitcpio scripts. It's not a bad idea, just more typing.
I think it's useless. We could also forget about PATH and always use /usr/bin/find... We could also ALWAYS use quotes. Now, should we replace: find . -type f by: "/usr/bin/find" "." "-type" "f" or make light and readable scripts, using the ${} form when necessary?
Um, first off, you *should* use full paths. The rationale has nothing to do with PATHs, but more to do with PATH ordering and things like that. If I'm calling /usr/bin/foobar and happen to have a totally unrelated 'foobar' in a path before /usr/bin, you're going to get stupid results. Additionally, the following will completely cripple non-full path binaries: function grep () { echo "lolfaild" return 1 } Whoops, now all those calls to "grep" are wrong. /bin/grep still works fine. Secondly, quoting everything is just plain stupid. Quoting only needs to be used on variable expansion (or, obviously, hardcoded paths with spaces). So the way your above line SHOULD be used: /usr/bin/find . -type f