[aur-general] TU Application - Ike Devolder

Florian Pritz bluewind at xinu.at
Sat Mar 3 15:11:45 EST 2012


On 03.03.2012 21:02, Bjoern Lindig wrote:
> Hi Xyne,
> 
> this is the noop listening your conversations ... 
>> 
>> I too think that your PKGBUILDs look good. They're clean and
>> well-structured. The only issue I see is the lack of variable
>> quoting, e.g. I've seen this is many of them:
>> 
>> make DESTDIR=${pkgdir} install
>> 
>> That will not work if there is a space on the pkgdir path. For
>> example:
>> 
>> $ mkdir 'foo bar'
>> $ foo='foo bar'
>> $ cd ${foo}
>> bash: cd: foo: No such file or directory
> 
> I'd like to pick up the chance to clearify this for my personal record,
> because I had problem with the space in the pkgdir path. What do you
> suggest? Is this meant by "variable quoting"?
> 
> $ cd "${foo}"
> 
> What would be a apropriate solution in the PKGBUILD? This?
> 
> make DESTDIR="${pkgdir}" install

quoting refers to the " or ' characters (that's called a double/single
quote).

cd "$foo"; is all you need

${foo} can be used in the case where your variable is named "foo", but
you want to add something directly after it without a space:

foo="test"
cd "${foo}bar" -> testbar

whereas:
cd "$foobar" will try to look for a variable called $foobar rather than
using $foo

-- 
Florian Pritz

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.archlinux.org/pipermail/aur-general/attachments/20120303/8eae970e/attachment.asc>


More information about the aur-general mailing list