OT: Regex question

Keary Suska yellowdog-general@lists.terrasoftsolutions.com
Fri May 3 12:29:01 2002


on 5/3/02 12:01 PM, lists0501@guitar.net purportedly said:

> I want to eliminate a directory from a nightly backup script. Being a
> bit of a regex newbie I'm scratching my head.
> 
> Here's what I've got so far:
> 
> tar -czf /path/to/[a-z]*
> 
> I'd like to keep that rule (omitting directories beginning with a
> capital) and also omit a directory named "houseofbig.com". How would
> I do this?
> 
> Thanks in advance for your help.

This isn't a regex issue, but an expansion/glob issue. Your options depend
on the shell used. IIRC, there isn't a way using shell expansion to get the
kind of specific results you want (i.e., without calling a separate
executable). Although there are many ways to do this, the simplest is
probably to use the -X option to tar. man tar for more info.

Keary Suska
Esoteritech, Inc.
"Leveraging Open Source for a better Internet"