Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: ls g^h



2009/1/26 zzapper <david@xxxxxxxxxx>:
> Mikael Magnusson wrote in
> news:237967ef0901240945y4c908dccn4c1c1deb2c9f0a2c@xxxxxxxxxxxxxx:
>
>> 2009/1/23 zzapper <david@xxxxxxxxxx>:
>>> Henno Brandsma wrote in
>>> news:900AB2BB-03D0-494A-99FF-D364BD0C31A4@xxxxxxxxx:
>>>
>>>>
>>> Thanks Henno
>>>
>>> trying to work out where this would be useful
>>>
>>>  ls -1 *.^txt    # list all but *.txt
>>>
>>> any more?
>>
>> % rm -rf Pictures_of_^beautiful_flowers
>> removed directory: `Pictures_of_old_garbage'
>> removed directory: `Pictures_of_random_junk'
>>
> The conventional zsh way would be?
> ls *.*~*.txt
> rm -rf Pictures_of_*~*beautiful_flowers

There is a small difference between ^ and ~ in this context. ~ matches
the whole globbed string while ^ only matches a single element, IIRC
at least. So you can do a/^foo/blue which is not the same as
a/*/blue~foo/blue but rather a/(*~foo)/blue, again IIRC.

-- 
Mikael Magnusson



Messages sorted by: Reverse Date, Date, Thread, Author