[EMAIL PROTECTED] wrote:
> Julian Andres Klode:
>> I attached two small patches from the Debian package, fixing bashisms in =
>> auplink
>> and some things related to security-inode-permission.
>       :::
>> diff -urNad aufs-0+20080317~/util/auplink aufs-0+20080317/util/auplink
>> --- aufs-0+20080317~/util/auplink    2008-03-10 05:46:04.000000000 +0100
>> +++ aufs-0+20080317/util/auplink     2008-03-17 13:42:52.000000000 +0100
>> @@ -37,14 +37,12 @@
>> =20
>>  Find() # dir [ find_args ]
>>  {
>> -    local dir=3D"$1"
>>      shift
>> -    find "$dir" -xdev -noleaf $@
>> +    find "$1" -xdev -noleaf $@
>>  }
>> =20
>>  List()
>>  {
>> -    local args
>>      sed -e 's/^\([0-9]*\) .*$/-o -inum \1/' |
>>      cut -c3- |
>>      xargs -n 200 |
> 
> I am afraid this patch is not right.
> 
> - in Find(), this patch makes $@ to include $1.
No. This is done via shift. shift removes $1 from $@ and makes $1 to be the same
as $2 was previously.

> - in List(), the variable 'arg' should be local.
Your script uses /bin/sh. By definition, /bin/sh on a Linux system is a
POSIX-compatible shell. And POSIX shells do not support local variables, only
global ones.

You have two options to fix this:
 1) Make all local functions global
 2) Replace #!/bin/sh with #!/bin/bash

I would prefer option 1, because there are no globally defined variables with
this name.

The other option is to simply use #!/bin/bash instead of #!/bin/sh. But this is
no good idea, because bash is much slower compared two other shells.
> 
> 
> Junjiro Okajima


-- 
Julian Andres Klode, Fellow of the Free Software Foundation Europe
                     Debian Maintainer | Developer | Ubuntu Member

try Debian: http://www.debian.org/ | my site: http://jak-linux.org/
        jabber: [EMAIL PROTECTED] | IRC: juliank (FreeNode, OFTC)
            languages:     German  | English

Attachment: signature.asc
Description: OpenPGP digital signature

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

Reply via email to