On Mon, 29 Aug 2005, Eliyah Kilada wrote:

> - I agree with [you] that a shell script is more appropriate, but how 
> can I write regular expressions in this way ? ;-)

By typing them, naturally :-)

In shell scripts, grep, sed & awk are the common regex using tools; 
depending on what you're doing, one or another might be the most useful 
one to make use of in a script.

grep does basic regex pattern matching

sed is a Stream EDitor, and can do regex substitutions etc

awk is more complex, almost like a baby version of Perl, but weirder

For my needs, grep & sed are usually enough for most simple shell 
scripts, and if I need to make it complex enough that I'm considering 
using awk, I just write the whole thing in Perl instead. On the other 
hand, a lot of people, eveen now, use awk all the time.

In any case, there are several useful ways to get regexes into your 
shell scripts, should you have the need to do so.



-- 
Chris Devers

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to