From owner-freebsd-questions Wed May 8 8:16: 0 2002 Delivered-To: freebsd-questions@freebsd.org Received: from spin.web.net (spin.web.net [192.139.37.16]) by hub.freebsd.org (Postfix) with ESMTP id 0A77637B408 for ; Wed, 8 May 2002 08:15:56 -0700 (PDT) Received: by spin.web.net (Postfix, from userid 1000) id AF18812EC2B; Wed, 8 May 2002 11:15:51 -0400 (EDT) Date: Wed, 8 May 2002 11:15:51 -0400 From: Rob Ellis To: Drew Tomlinson Cc: questions@freebsd.org Subject: Re: Basic RegEx Syntax Help - grep Message-ID: <20020508151551.GA18811@web.ca> References: <001a01c1f6a2$35d4adf0$6e2a6ba5@lc.ca.gov> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <001a01c1f6a2$35d4adf0$6e2a6ba5@lc.ca.gov> User-Agent: Mutt/1.3.28i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Use "egrep": pkg_info | egrep 'libglade|rep-gtk' -i (ignore case) is useful for package names where the capitalization can be odd... pkg_info | egrep -i 'libglade|rep-gtk' - Rob On Wed, May 08, 2002 at 08:08:28AM -0700, Drew Tomlinson wrote: > I'm trying to grep the output of pkg_info to show me lines containing > "libglade" OR "rep-gtk". In reading the man page, I see that | is the > "infix" (OR) operator. What is the correct syntax to use this command? > Everyway I have tried it, the shell sees | as a pipe and not the infix > operator. Here's some of the commands I've tried: > > milkmaker# pkg_info | grep libglade|rep-gtk > rep-gtk: Command not found. > > milkmaker# pkg_info | grep "libglade"|"rep-gtk" > rep-gtk: Command not found. > > milkmaker# pkg_info | grep ['libglade'|'rep-gtk'] > grep: Unmatched [ or [^ > > milkmaker# pkg_info | grep [libglade|rep-gtk] > grep: Unmatched [ or [^ > > milkmaker# pkg_info | grep [libglade] | [rep-gtk] > grep: No match. > [rep-gtk]: No match. > > Help! :) > > Thanks, > > Drew > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message