Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 May 2002 08:08:28 -0700
From:      "Drew Tomlinson" <drew@mykitchentable.net>
To:        <questions@freebsd.org>
Subject:   Basic RegEx Syntax Help - grep
Message-ID:  <001a01c1f6a2$35d4adf0$6e2a6ba5@lc.ca.gov>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?001a01c1f6a2$35d4adf0$6e2a6ba5>