file moving problems
David Henderson
dhenderson at digital-pipe.com
Sat Feb 12 16:19:33 UTC 2011
Ralf Friedl wrote:
> Denys Vlasenko wrote:
>> On Thursday 10 February 2011 21:40, David Henderson wrote:
>>> I can do a "cp -dpR !(b.txt) d" within bash using the full cp
>>> command to move everything except b.txt into the d directory.
>>
>> This doesn't work for me even in bash:
>>
>> $ echo cp -dpR !(b.txt) d
>> bash: !: event not found
> It would work in bash if you use it an a script or quote the "!" on
> the command line to prevent history expansion, and (from man bash):
> If the extglob shell option is enabled using the shopt builtin,
> several extended pattern matching operators are recognized...
>
> But it is a very obscure feature, and nobody ever claimed that ash
> supports all features of bash.
>
> Ralf
>
I can use that syntax directly from the bash prompt without being in a
script or quoting the "!" symbol. You do, however, have to have the
extglob enabled as you mentioned. Also, this was being used within a
shell script using the shebang on #!/bin/bash so bash should be
executing the script and not ash. At any rate, I think I figured out a
work around. Thanks for everyone's help.
Dave
More information about the busybox
mailing list