Re: [Hampshire] Regular Expressions

Top Page

Reply to this message
Author: Dr Adam J Trickett
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] Regular Expressions
On Wed, 02 Apr 2008 at 03:51:55PM +0100, Chris. Aubrey-Smith wrote:
> I'm re-reading Kernighan & Pike, "The Unix Programming Environment",
> in an attempt to resurrect my Regular Expression skills. However, I'm
> finding that many of my old and trusted shell scripts won't work.
>
> Of course, I'm aware of some differences between bourne and bash, but
> I'm surprised to find so many odd and apparently needless discrepancies.


I'm told that Mastering Regular Expressions is very good:
    http://www.oreilly.com/catalog/regex3/


I have an older edition which I found most useful.

> For example, the text gives the following as an illustration:
>
> Quotes of one kind protect quotes of the other kind:
>
> $ echo "Don't do that!"
> Don't do that!
> $
>
> However, in bash on my Debian machine:
>
> chris@T42:~$ echo "Don't do that!"
> bash: !": event not found


Works fine on my Debian machine (Bash 2.05b.0(1)-release)

--
Adam Trickett
Overton, HANTS, UK

Blessed are the pessimists, for they test their backups.
    -- anon