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

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Grep Error in Solaris 8

Reply to Message Icon

Name: sukrut_1
Date: September 14, 2003 at 00:17:41 Pacific
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 . . .



Sponsored Link
Ads by Google

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

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


0

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

Hi David

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


0

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

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.


0

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

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


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Solaris Forum Home


Sponsored links

Ads by Google


Results for: Grep Error in Solaris 8

How to install oracle 8i in solaris 8 www.computing.net/answers/solaris/how-to-install-oracle-8i-in-solaris-8/925.html

installing CD-RW in solaris 8 www.computing.net/answers/solaris/installing-cdrw-in-solaris-8/2904.html

Printer installation in solaris 8. www.computing.net/answers/solaris/printer-installation-in-solaris-8/3463.html