[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATCH] bug in coreutils/unlink.c
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2014-06-23 11:20:06
Message-ID: CAK1hOcPJJqgAZ4+HbJ3BuNiXNjB=4vvo0vCqJeYBG9R7A2aMSA () mail ! gmail ! com
[Download RAW message or body]

On Mon, Jun 23, 2014 at 12:10 PM, Xabier Oneca  --  xOneca
<xoneca@gmail.com> wrote:
>> be studying further the matter files starting with a dash
>> could be successfully removed with bb's and original unlink with:
>>
>> echo > -test
>> unlink -- -test
>>
>> so eventually the patch could be dropped.
>>
>> Ciao,
>> Tito
>
> You could also use /absolute/-paths or ./-relative-paths. But '--' is
> used to separate options from arguments (in applications that support
> it, e.g. those which use getopt), so the "canonical" way is using
> double-dashes.

Yes, because of scripting. Think about this:

unlink -- "$FILENAME"   # works for any name
unlink "./$FILENAME"   # fails for absolute names
unlink "$PWD/$FILENAME"   # ditto
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic