in reply to Acceptable regular expressions within command line type syntax

You need to look at the manual (or man page) for your particular shell, since there is some difference (e.g. some shells will expand a.{c,o} and some won't

As is often the case, when explained, the obvious seems so ... obvious

What I wasn't grasping, I believe, is that in my example, I'm need to use available _wildcards_ available from my (bash) shell. And if the widlcards aren't robust enough, then adapt some perl to feed the correct info.

In my case, I believe the earlier suggestion:

open(TAR,"tar -czpf $target_file $logs/access_log.[0-9]*.gz |");
will do the trick

Thanks all .....

  • Comment on Re: Acceptable regular expressions within command line type syntax
  • Download Code

Replies are listed 'Best First'.
Re: Re: Acceptable regular expressions within command line type syntax
by Thelonius (Priest) on Jun 06, 2003 at 17:07 UTC
    In my case, I believe the earlier suggestion:
    open(TAR,"tar -czpf $target_file $logs/access_log.[0-9]*.gz |");
    will do the trick.
    While it will probably do the trick, be aware that it is not equivalent. It will also match, e.g. "access_log.20dontsave.gz".

    A glob of access_log.[0-9]*.gz is equivalent to a regex of /^access_log\.\d.*\.gz$/