grep -e doesn't work on solaris


 
Thread Tools Search this Thread
Operating Systems Solaris grep -e doesn't work on solaris
# 1  
Old 08-14-2008
grep -e doesn't work on solaris

grep -e doesn't work in Soalris.

Same script with grep -e worked on AIX/HP/LINUX..

I would like to search a list of patterns on "log.txt" like ...
grep -e FATAL -e ERROR log.txt

I get the error message as
grep: illegal option -- e
Usage: grep -hblcnsviw pattern file . . .

Last edited by jmkraja; 08-14-2008 at 01:17 AM..
# 2  
Old 08-14-2008
Found the problem myself :-)...

The following options are supported for /usr/xpg4/bin/grep only
-e -E -f -F -q -x.
These options doesn't work with /usr/bin/grep
# 3  
Old 08-14-2008
The use of multiple -e options has always been something of an undocumented feature anyway. To use only standard, documented, portable facilities, you might want to egrep 'FAILURE|ERROR' or some rough equivalent of { echo FAILURE; echo ERROR } | fgrep -f - (and actually I guess the latter won't work on some crude platforms either; specifying standard input with a dash as the argument to the -f option isn't really portable, either, IIRC).
# 4  
Old 08-14-2008
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grep doesn't work when assigning to variable

Hello, First of all, I'd like to say hello to all members of forum. Can You please help me with the matter described below? I am trying to fetch a data from the file to variable, I am doing this using below script: returned=`tail -50 SapLogs.log | grep -i -E "Error|"` echo $returned ... (2 Replies)
Discussion started by: jedzio
2 Replies

2. Shell Programming and Scripting

pipe to grep doesn't work in bash script

Hi, I'm trying to write a script that checks gvfs to see if a mount exists so I can run it from network-manager's status hooks. I thought I'd pipe the output of gvfs-mount -l to grep for the particular mounts I care about. When I do this in a bash script: cmnd="gvfs-mount -l | grep -i... (4 Replies)
Discussion started by: kcstrom
4 Replies

3. Shell Programming and Scripting

tail -XXX with grep doesn't work in while loop

Hi all, I need some help. my shell script doesn't work especially in the loop. #!/bin/sh -xv export ORA_ADMIN=/oracle/home/admin export ORACLE_SID=ORA_SID cat ${ORA_ADMIN}/param_alert_log.ora | while read MSG do #echo $MSG #echo "tail -400... (8 Replies)
Discussion started by: sidobre
8 Replies

4. Shell Programming and Scripting

two grep in one script doesn't work?

Hi there, the following script doesn't work. the first part works, then the second 'grep' fails with ': not found'. However, if I take out the second part (starting with the grep command) and put in a seperate script, it works. everyone know what's wrong here? no two 'grep' in one script, that... (2 Replies)
Discussion started by: monkey77
2 Replies

5. UNIX for Dummies Questions & Answers

For some reason, my grep doesn't work as expected

I am trying to find only those entries where 7018 and another number appear in the end of the line. 7018 2828 1423 2351 7018 2828 14887 2828 7018 1222 123 7018 1487 I am looking for a way to generate only the last two lines. I was trying to do just "grep '7018{1,5}" but it does not... (5 Replies)
Discussion started by: Legend986
5 Replies

6. Solaris

Solaris Network doesn't work properly

Hi to all! I want to learn step by step easily how to configure my Solaris for network. I know alot about Solaris Network configuration. But I have some problems. When I install Solaris, and I plug-in my network cable to Solaris. Then I run: ifconfig -a plumb then I do ifconfig bge0 dhcp... (7 Replies)
Discussion started by: SecureXCode
7 Replies

7. UNIX for Dummies Questions & Answers

Mail/Xmail doesn't work on Solaris 10

Hi again everyone. I have recently installed Solaris 10 on a server. Everything seems to work fine (users can be added and can log in, internet connectivity works, etc). However I'm struggling to get mail or mailx to work. Say there are two users on my server, Bob and Mary. Server hostname... (3 Replies)
Discussion started by: EugeneG
3 Replies

8. Shell Programming and Scripting

ls -d doesn't work on Solaris

Hello, the ls -d command to only list directories in a directory doesn't seem to work on Solaris and the man command says to use that combination: ls -d Anyone have the same problem and find a resolve? Thanks BobK (9 Replies)
Discussion started by: bobk544
9 Replies

9. UNIX for Advanced & Expert Users

rcp on solaris doesn't work

Hi I have 2 Solaris boxes A and B, A running solaris 9, and B running solaris 6. when i try to use rcp on A like this:- A> rcp file.txt B:/path/file.txt I get into standard input and nothing happens!! Then On the target machine B, if i try, B> rcp otherfile.txt B:/path/otherfile.txt... (1 Reply)
Discussion started by: 0ktalmagik
1 Replies

10. Shell Programming and Scripting

grep doesn't work within shell script?

I am trying to run the following code from a script file but it complains that syntax of (both instances of) grep is wrong. When I copy and paste it to the terminal, it is OK. Any idea what the problem might be? set i = `grep -c #define flags.h` while ($i>20) @ i-- my func (`cat... (4 Replies)
Discussion started by: barisgultekin
4 Replies
Login or Register to Ask a Question