From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fed1rmmtao05.cox.net ([68.230.241.34]) by speech.braille.uwo.ca with esmtp (Exim 3.36 #1 (Debian)) id 1DIaup-0008Ev-00 for ; Mon, 04 Apr 2005 19:23:31 -0400 Received: from nedelko83f1172 ([68.228.49.78]) by fed1rmmtao05.cox.net (InterMail vM.6.01.04.00 201-2131-118-20041027) with SMTP id <20050404232255.JBWQ7956.fed1rmmtao05.cox.net@nedelko83f1172> for ; Mon, 4 Apr 2005 19:22:55 -0400 Message-ID: <001801c5396d$3dd1b820$4e31e444@nedelko83f1172> From: "Ned" To: "Speakup is a screen review system for Linux." References: <000801c5393a$d6684050$4e31e444@nedelko83f1172> <20050404230311.GA4731@taylor.homelinux.net> Date: Mon, 4 Apr 2005 16:22:59 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Subject: Re: bash regular expressions X-BeenThere: speakup@braille.uwo.ca X-Mailman-Version: 2.1.5 Precedence: list Reply-To: "Speakup is a screen review system for Linux." List-Id: "Speakup is a screen review system for Linux." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Apr 2005 23:23:32 -0000 Thanks bro, it definitely works. Now, as you pointed out, why the \ is not enough, we'll leave that for some later time. Ned ----- Original Message ----- From: "Lorenzo Taylor" To: "Speakup is a screen review system for Linux." Sent: Monday, April 04, 2005 4:03 PM Subject: Re: bash regular expressions > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Ned's comments on bash regular expressions were as follows: > # I wrote a bash script and all but the two commands below were marked > wrong, so I need to correct them. Hope you don't mind pointing out my > mistakes: > > Well, I'll see what I can do. Here goes nothing! > > # 1. needs to output how many lines are there with a . (period) in them. I > used the escape char \ before the period, but it apparently didn't work. > # > # echo Output the number of lines that have a \"\.\" \(period\): > # grep -c \. ./test.file > > Try: > > echo Output the number of lines that have a \".\" \(period\): > grep -c [.] ./test.file > > I can't explain it, but somehow it only works that way. Escaping the > period > doesn't help. It must be specified in a range by itself. > > # 2. this one needs to output the number of lines containing the string > '/*': > # > # echo Output the number of lines that have the string \"'/'\*\": > # grep -c /\* ./test.file > > Try this instead: > > echo Output the number of lines that have the string '"/*"': > grep -c [/][*] ./test.file > > Again, each character seems as though it must be enclosed in range > brackets by > itself. Not exactly sure why without further digging in manpages for > grep(1) and > regex(3), which is something I may do in the future if the mood hits me, > but as > long as this works, I just don't feel like it right now. > > HTH, > Lorenzo > - -- > "We decided that we should evaluate the Microsoft offerings first. Once we > realised what a powerful set of tools they were, it became self-evident > this was > the right way to go down." > > Microsoft: the right way to go down > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.0 (GNU/Linux) > > iD8DBQFCUcevG9IpekrhBfIRAs1uAJ9/qfMLcyIuzP19Tx8I5HlIbEC/VACeJHod > RaMPPXLUHrKsBmDFYk2f2p4= > =R6qv > -----END PGP SIGNATURE----- > > _______________________________________________ > Speakup mailing list > Speakup@braille.uwo.ca > http://speech.braille.uwo.ca/mailman/listinfo/speakup