Mailinglist Archive: radeonhd (529 mails)

< Previous Next >
Re: [radeonhd] [PATCH 2/2] Get rid of another potential quoting problem
  • From: Matthias Hopf <mhopf@xxxxxxx>
  • Date: Wed, 5 Dec 2007 12:57:00 +0100
  • Message-id: <20071205115700.GA12071@xxxxxxx>
On Dec 04, 07 18:51:12 +0100, Hans Ulrich Niedermann wrote:
$(cmd) is not a bashism. $(cmd) is POSIX sh, and is supported by most
shs even if they are not strictly POSIX in other ways.

Ok, didn't know that this is POSIX now. I just remember the days when
one had to write 'if [ "x$1" != x ] ; then' in order to not get bashed
by sh (what a phrase ;)

Correct quoting with $() is easy (for file and directory names with
spaces e.g.). Correct quoting and escaping with `` frankly escapes me,
though, and IIRC there were some things that could not be quoted
correctly at all with ``. You're welcome to help me there, of course.

It's not as complex - as long as no additional ` is included, all
escaping in the subshell is unrelated, so
a="`cmd "single argument"`"
is perfectly valid and working.

Nevertheless, you're used to $(), so keep it.

E.g. git's scripts use sh functions and $() substitution.

Strong point.

Matthias

--
Matthias Hopf <mhopf@xxxxxxx> __ __ __
Maxfeldstr. 5 / 90409 Nuernberg (_ | | (_ |__ mat@xxxxxxxxx
Phone +49-911-74053-715 __) |_| __) |__ R & D www.mshopf.de
--
To unsubscribe, e-mail: radeonhd+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: radeonhd+help@xxxxxxxxxxxx

< Previous Next >