LXF66 Shell secrets article

Comments, suggestions and questions about Linux Format magazine and the coverdiscs

Moderators: ChrisThornett, LXF moderators

LXF66 Shell secrets article

Postby Nigel » Sun Apr 24, 2005 11:24 am

Reading the Shell secrets article in LXF66 I noticed a couple of problems:

1. In the first section, 4th example... I may be wrong, but I don't think that the regex /^linux.*format$/ will match with either "linux Format" or "Linux users love Linux Format" by default... you need to have a flag set to ignore case.

Which brings me to:

2. on the second page, where you mention the case-insensitive flag for grep, it is correctly printed as "-i" in the code example, but referred to as "-l" in the text.

Hopefully these are just glitches that crept in during the typesetting/layout stage :oops:

Otherwise a good article - I especially like the broken bookmarks example.


Nigel.
User avatar
Nigel
LXF regular
 
Posts: 1141
Joined: Fri Apr 08, 2005 8:03 pm
Location: Gloucestershire, UK

I tend to agree, plus a few more comments ...

Postby txtedmacs » Mon Apr 25, 2005 4:02 pm

1. In the first section, 4th example... I may be wrong, but I don't think that the regex /^linux.*format$/ will match with either "linux Format" or "Linux users love Linux Format" by default... you need to have a flag set to ignore case.


That's exactly what I thought. Moreover, the slashes do not work on all distributions - e.g. on my laptop that still has Mdk 9.1 Pro I had to use single quotes, though I would have preferred to have used the slashes, which are used in perl regular expressions. Furthermore in perl you specifically set the ignore case as grep /.../i . Now finally add the warning I have seen: the switch/option on bash to ignore case (I believe is -i) does not work on all versions of bash! [Again, I really prefer the slash notation and when I am doing a match using php I use them; moreover, to protect my matching to ignore the case I use the syntax I noted above within the php functions.]

I had some other problems that I would have preferred to have written the author about directly, however, so far I have received no advice on how to email him.

These comments are NOT meant to be overly critical - I want to see this and other series on the command line continued. Please keep them coming!!
txtedmacs
 
Posts: 6
Joined: Sat Apr 23, 2005 10:36 pm


Return to Magazine and coverdiscs

Who is online

Users browsing this forum: No registered users and 2 guests