Computing.Net > Forums > Solaris > Grep Error in Solaris 8

Grep Error in Solaris 8

Reply to Message Icon

Original Message
Name: sukrut_1
Date: September 14, 2003 at 00:17:41 Pacific
Subject: Grep Error in Solaris 8
OS: Solaris 8
CPU/Ram: 4gb
Comment:

Hello All,
> > Hello All,
I am executing one script in Solaris 8 and after execution I am getting following error.
> > Usage: grep -hblcnsviw pattern file . . .


Report Offensive Message For Removal


Response Number 1
Name: David Perry
Date: September 14, 2003 at 07:11:01 Pacific
Reply: (edit)

It is telling you that your incorrectly using grep. Probably you are trying to use command line flags that are valid with gnu grep.


Report Offensive Follow Up For Removal

Response Number 2
Name: sukrut_1
Date: September 15, 2003 at 08:13:19 Pacific
Reply: (edit)

Hi David

I can understand but can you tell me any workaround for that as my all remaining scripts are working properly.


Report Offensive Follow Up For Removal

Response Number 3
Name: David Perry
Date: September 15, 2003 at 09:28:22 Pacific
Reply: (edit)

You could post what you are trying to do and I could tell you a different way or you could download and use the gnu grep from

ftp://ftp.sunfreeware.com/pub/freeware/sparc/8/grep-2.5-sol8-sparc-local.gz

be sure to use the full path name /usr/local/bin/grep in you scripts.


Report Offensive Follow Up For Removal

Response Number 4
Name: sukrut_1
Date: September 16, 2003 at 00:42:04 Pacific
Reply: (edit)

Hi David

I am psoting my script on this site so please adivse me where should I make modification as I have installed GNU Grep and I have assigned proper PATH on in $PATH i.e /usr/local/bin/grep


#!/bin/sh
# $Header: hot_database_backup.sh,v 1.9 2002/02/06 16:48:56 lstrub Stab $

CUSER=`id |cut -d"(" -f2 | cut -d ")" -f1`

RMAN_LOG_FILE=/u08/rmantest/disk1.out


if [ -f "$RMAN_LOG_FILE" ]
then
rm -f "$RMAN_LOG_FILE"
fi


echo >> $RMAN_LOG_FILE
chmod 666 $RMAN_LOG_FILE


echo Script $0 >> $RMAN_LOG_FILE
echo ==== started on `date` ==== >> $RMAN_LOG_FILE
echo >> $RMAN_LOG_FILE

ORACLE_HOME=/u01/app/oracle/product/8.1.7
export ORACLE_HOME


ORACLE_SID=ATRTEST
export ORACLE_SID


ORACLE_USER=oracle


TARGET_CONNECT_STR=sys/manager@ATRTEST


RMAN=$ORACLE_HOME/bin/rman


echo >> $RMAN_LOG_FILE
echo "RMAN: $RMAN" >> $RMAN_LOG_FILE
echo "ORACLE_SID: $ORACLE_SID" >> $RMAN_LOG_FILE
echo "ORACLE_USER: $ORACLE_USER" >> $RMAN_LOG_FILE
echo "ORACLE_HOME: $ORACLE_HOME" >> $RMAN_LOG_FILE

echo >> $RMAN_LOG_FILE
echo "NB_ORA_FULL: $NB_ORA_FULL" >> $RMAN_LOG_FILE
echo "NB_ORA_INCR: $NB_ORA_INCR" >> $RMAN_LOG_FILE
echo "NB_ORA_CINC: $NB_ORA_CINC" >> $RMAN_LOG_FILE
echo "NB_ORA_SERV: $NB_ORA_SERV" >> $RMAN_LOG_FILE
echo "NB_ORA_POLICY: $NB_ORA_POLICY" >> $RMAN_LOG_FILE


echo >> $RMAN_LOG_FILE

if [ "$NB_ORA_FULL" = "1" ]
then
echo "Full backup requested" >> $RMAN_LOG_FILE
BACKUP_TYPE="INCREMENTAL LEVEL=0"

elif [ "$NB_ORA_INCR" = "1" ]
then
echo "Differential incremental backup requested" >> $RMAN_LOG_FILE
BACKUP_TYPE="INCREMENTAL LEVEL=1"

elif [ "$NB_ORA_CINC" = "1" ]
then
echo "Cumulative incremental backup requested" >> $RMAN_LOG_FILE
BACKUP_TYPE="INCREMENTAL LEVEL=1 CUMULATIVE"

elif [ "$BACKUP_TYPE" = "" ]
then
echo "Default - Full backup requested" >> $RMAN_LOG_FILE
BACKUP_TYPE="INCREMENTAL LEVEL=0"
fi

CMD_STR="
ORACLE_HOME=$ORACLE_HOME
export ORACLE_HOME
ORACLE_SID=ATRTEST
export ORACLE_SID
$RMAN target $TARGET_CONNECT_STR rcvcat rman/rmanager@$ORACLE_SID msglog $RMAN_LOG_FILE append > $RMAN_LOG_FILE
RSTAT=$?
else
/usr/bin/sh -c "$CMD_STR" >> $RMAN_LOG_FILE
RSTAT=$?
fi

if [ "$RSTAT" = "0" ]
then
LOGMSG="ended successfully"
else
LOGMSG="ended in error"
fi

echo >> $RMAN_LOG_FILE
echo Script $0 >> $RMAN_LOG_FILE
echo ==== $LOGMSG on `date` ==== >> $RMAN_LOG_FILE
echo >> $RMAN_LOG_FILE

exit
$RSTAT


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Grep Error in Solaris 8

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge