[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 38



On 27 August 2010 18:20, Adam Borowski <kilobyte@angband.pl> wrote:
> On Fri, Aug 27, 2010 at 10:09:49AM +0200, posion bit wrote:
>> > (/etc/mc/mc.menu)
>> >          case "$i" in
>> >            *.tar.gz)  D="`basename $i .tar.gz`";;
>>
>> mmmm In that case, name-spaced filenames should work, because the
>> string is a _quoted_ multi-word string.
>
> i="cat's meow.tar.gz"
>
> basename: extra operand `.tar.gz'
> Try `basename --help' for more information.

When the solution is easy I don't see why we don't just do it.

brian@andean:~$ i="cat's meow.tar.gz"
brian@andean:~$ echo "`basename "$i" .tar.gz`"
cat's meow

(yes, the nested quotes don't seem to matter)
-- 
Brian May <brian@microcomaustralia.com.au>


Reply to: