|
Home > Archive > Unix Shell > February 2007 > grep -x option not working on Sun?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
grep -x option not working on Sun?
|
|
| zeokamen@gmail.com 2007-02-19, 1:16 pm |
| The following command works fine on HP-UX but not on Sun? How can I do
an exact string search on Sun? I need a command that will work fine on
both Sun and HP.
ps -ef|grep -x "swapper"
grep: illegal option -- x
Usage: grep -hblcnsviw pattern file . . .
| |
| OldSchool 2007-02-19, 1:16 pm |
| On Feb 19, 12:58 pm, zeoka...@gmail.com wrote:
> The following command works fine on HP-UX but not on Sun? How can I do
> an exact string search on Sun? I need a command that will work fine on
> both Sun and HP.
>
> ps -ef|grep -x "swapper"
> grep: illegal option -- x
> Usage: grep -hblcnsviw pattern file . . .
according to sun's man pages they have two versions"
http://docs.sun.com/app/docs/doc/81...mbb0m9hu?a=view
/usr/xpg4/bin/grep supports the -x option
| |
| Stephane CHAZELAS 2007-02-19, 7:15 pm |
| 2007-02-19, 09:58(-08), zeokamen@gmail.com:
> The following command works fine on HP-UX but not on Sun? How can I do
> an exact string search on Sun? I need a command that will work fine on
> both Sun and HP.
>
> ps -ef|grep -x "swapper"
> grep: illegal option -- x
> Usage: grep -hblcnsviw pattern file . . .
Try:
command -p grep -x swapper
instead (assuming your shell is Unix conformant).
I would also make sure my $PATH contains the standard utility.
Often by default, on Solaris, you get the legacy ones first.
PATH=$(getconf PATH):$PATH
--
Stéphane
|
|
|
|
|