On Fri, 29 Feb 2008, Don Sparish wrote:
> Is Solaris Ass Backward or what.
I've put all GNU utils on my Solaris box. I'll be retiring it soon.
> I can get an exact string match in AIX, Linux, HPUX but not in SlowLaris.
>
> What I have tried so far,
>
> grep -x returns a usages messages
> /usr/xpg4/bin/grep -x doesn't work
I don't know why that is happening to you. On my Solaris 8 box, the old
/usr/xpg4/bin/grep is there and working and it accepts -x. Man page:
man -M /usr/man grep
That includes info for both the xpg4 and /usr/bin versions. The xpg4
version can be used in a few ways:
/usr/xpg4/bin/grep [ -E | -F ] [ -c | -l | -q ] [
-bhinsvwx ] -e pattern_list ... [ -f pattern_file ] ...
[ file ... ]
/usr/xpg4/bin/grep [ -E | -F ] [ -c | -l | -q ] [
-bhinsvwx ] [ -e pattern_list ... ] -f pattern_file ... [
file ... ]
/usr/xpg4/bin/grep [ -E | -F ] [ -c | -l | -q ] [
-bhinsvwx ] pattern [ file ... ]
> grep -e or -E returns a usages message
>
> /user/xpg4/bin/grep -e or -E doesn't work
Not because of misspelling "user"? It works for me.
> grep '\<string\>' doesn't work
>
> grep ^"string"$ doesn't work.
>
> What I am trying to do is search an environment variable such as PATH to
> see if a directory already exist in the variable.
>
> Anybody figured out how to find exact matches within a string on
> SlowLaris?
This works for me on Solaris 8 SPARC from the command line in both bash
and tcsh:
echo $PATH | tr ':' '\n' | /usr/xpg4/bin/grep -x '/usr/openwin/bin'
That works here, so I'm thinking your /usr/xpg4/bin/grep was replaced by
something nonstandard. Check into it. Make sure your system wasn't
attacked and altered.
If you are using SPARC and want to try my grep file, I can send it to you.
Mike