Cees van de Griend wrote:
On Sat, Oct 28, 2000 at 06:50:24PM +0200, Eilert Brinkmann wrote:
To match all names except "." and ".." you could use the following combination of three patterns:
* .[^.]* ..[^.]*
* .[!.]*
These patterns will not match filenames beginning with two dots (e.g., "..foo"). However, as such names are quite unusual, this will probably not matter in most cases. But in general the third pattern must be given, too, to match all possible names except "." and "..". In bash [!.] ("original" shell syntax) and [^.] (as known from regular expressions) are equivalent when used in shell patterns. But other shells (e.g., ksh or /bin/sh of most Unix versions) don't recognize the [^.] form, so it's probably better habit to use [!.] like you did. Eilert -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Eilert Brinkmann -- Universitaet Bremen -- FB 3, Informatik eilert@informatik.uni-bremen.de - eilert@tzi.org - eilert@linuxfreak.com http://www.informatik.uni-bremen.de/~eilert/ -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq
On Mon, Oct 30, 2000 at 06:27:19PM +0100, Eilert Brinkmann wrote:
To match all names except "." and ".." you could use the following combination of three patterns: * .[^.]* ..[^.]*
* .[!.]*
These patterns will not match filenames beginning with two dots (e.g., "..foo"). However, as such names are quite unusual, this will probably not matter in most cases. But in general the third pattern must be given, too, to match all possible names except "." and "..".
Duh. You're right. But yours won't for filenames starting with "..."!. I'll admit right away that filenames starting with 3 dots are almost non-existend... So let's try again: * .[!.]* ..[!.]* ...* Regards, Cees. -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq
participants (2)
-
cees-list@griend.xs4all.nl
-
eilert@Informatik.Uni-Bremen.DE