[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ls.m behavior
From: |
Ben Abbott |
Subject: |
Re: ls.m behavior |
Date: |
Wed, 30 Nov 2011 19:31:39 -0500 |
On Nov 30, 2011, at 10:56 AM, Rik wrote:
> | | Anyone seeing this?
> | |
> | | dir *.m
> | | go_crop.m go_simple.m go_test.m
> | | ls *.m
> | | ls: *.m: No such file or directory
> | | error: ls: command exited abnormally with status 1
>
> | This is my fault, for introducing some quoting to try to allow things
> | like
> |
> | ls foo(1)bar
> |
> | to work. I'm not sure what the best fix is, but it can't be as simple
> | as what I did.
> |
> | jwe
>
> What about the attached changeset which escapes anything which isn't an
> ordinary word character or a special globbing character? Using this
> approach even the single quote is handled correctly.
>
> I didn't escape the bracket characters [ ] because I think more people
> would tend to use them as literal values rather than for globbing. That is
> one potential item to change.
>
> --Rik
>
> <ls.cset>
Works for me. I tried
ls *.m
and
system ("touch 'foo(1)bar'");
ls foo(1)bar
foo(1)bar
Both worked as expected.
Ben