Re: bash - pathname expansion controls 'set -f' or 'set -o noglob' on broken?

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



Dave you need to quote your variables ie.

var="*pacman*"; echo "$var"

so  printf "Search:  %s\n" $myvar should read

printf "Search:  %s\n" "$myvar"

On Thu, Aug 12, 2010 at 11:39 PM, David C. Rankin
<drankinatty@xxxxxxxxxxxxxxxxxx> wrote:
> On 08/13/2010 01:32 AM, David C. Rankin wrote:
>>
>> On 08/13/2010 01:15 AM, mike rosset wrote:
>>>
>>> quote command arguments like you would normally do.
>>>
>>> ie. $ myscript "*pacman*"
>>
>> Nope:
>>
>> 01:32 nirvana:~/scr/arch/tmp> ./tst.sh "pacman*"
>> Search: pacman-foo
>>
>>
>
> Mike,
>
>        I'm sorry, that was a short answer. My thoughts in this situation
> were that partial or soft-quoting "" would not offer any additional
> protection that full or hard-quoting '' did not already provide. From ABS:
>
>    partial quoting [double quote]. "STRING" preserves (from interpretation)
> most of the special characters within STRING.
>
>    full quoting [single quote]. 'STRING' preserves all special characters
> within STRING. This is a stronger form of quoting than "STRING".
>
>        I'd run across this a couple of days ago on the pacman -Ss reformat
> script work.
>
>
> --
> David C. Rankin, J.D.,P.E.
> Rankin Law Firm, PLLC
> 510 Ochiltree Street
> Nacogdoches, Texas 75961
> Telephone: (936) 715-9333
> Facsimile: (936) 715-9339
> www.rankinlawfirm.com
>


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux