A little late but as this is Solaris 10, GNU grep was probably already installed in /usr/sfw/bin/ggrep (not a typo the first g is for GNU).
|
Thanks guys.
But one quetion , this is simple but I really never did this to be honest What can I do to avoid using the full path Code:
/usr/local/bin/grep Code:
grep -C 2 user1 /etc/passwd Code:
/usr/local/bin/grep -C 2 user1 /etc/passwd and yes thanks for that "-C" option, its good one. |
you could put /usr/local/bin/ at the beginning of PATH
Warning: might break other things.. better solution .. try ggrep , if nothing then create a symlink in /usr/local/bin/ Code:
ln -s grep /usr/local/bin/ggrep you just have to remember to use ggrep never used solaris, but I assume you can use alias Code:
alias grep="/usr/local/bin/grep" alias ggrep=..... |
@manalisharmabe: I would first check if jlliagre solution works for you.
Assuming that ggrep isn't working for you: If you want/need to use GNU grep inside scripts I would set a variable at the beginning of that script that points to it. From that point on you can use the variable instead of the full path: Code:
#!/bin/bash |
Quote:
|
Quote:
Thanks Guys. |
Quote:
if it is for interactive use, then the ggrep symlink is probably best ( if ggrep doesn't already work, as pointed out by druuna ) |
It it isn't already, you can just put /usr/sfw/bin at the END of your PATH and if installed, ggrep will work as is.
|
yes as jlliagre points out, look for /usr/sfw/bin
really you need to figure out what you have installed on your system(s) |
All times are GMT -5. The time now is 11:01 AM. |