[K12OSN] Re: OT: bash help
"Terrell Prudé Jr."
microman at cmosnetworks.com
Sat Mar 8 20:03:36 UTC 2008
Try single quotes and see if that helps out. I've had similar issues in
the past. Also, you shouldn't need the "" after [Mm]; it's superfluous.
--TP
_______________________________
Do you GNU <http://www.gnu.org>?
Microsoft Free since 2003 <http://www.cmosnetworks.com>--the ultimate
antivirus protection!
Peter Hartmann wrote:
> Ok so this works in ksh:
>
> if [ ! -d "/home/vpopmail/domains/ascensionschoolnyc.org/"$name"/Maildir/."[Ss][Pp][Aa][Mm]""
> ];
>
> Why not bash?
>
>
> Peter
>
> On Sat, Mar 8, 2008 at 12:01 PM, Peter Hartmann <ascensiontech at gmail.com> wrote:
>
>> I'm trying to test if vpopmail users have a spam folder already, but
>> I'd like to make the directory test case insensitive.
>>
>> snip:
>>
>> if [ ! -d "/home/vpopmail/domains/domain.com/$name/Maildir/.[Ss][Pp][Aa][Mm]" ];
>> then
>> echo not there
>> fi
>>
>> This way the test fails even if there is a .spam folder.
>>
>> Without the quotes the regex is interpreted but when the directory is
>> there, I get a 'binary operator expected' error for the 'if' line.
>>
>>
>> What am I not getting?
>>
>> Thanks,
>> Peter
>>
>>
>
> _______________________________________________
> K12OSN mailing list
> K12OSN at redhat.com
> https://www.redhat.com/mailman/listinfo/k12osn
> For more info see <http://www.k12os.org>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/k12osn/attachments/20080308/57c8fdcd/attachment.htm>
More information about the K12OSN
mailing list