If statement failing with error "pc.sh[21]: [yscc02 =yscc02]: not found."
Dear all
I wrote a shell script which runs perfect in OEL linux 5.2 but its failing in AIX 5.3
this scripts check if db is up then it wont proceed else proceed with rest steps.
any help is appreciated.
--------------------------------------------
Code:
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/101
ORACLE_SID=yscc02
NLS_LANG=AMERICAN_AMERICA.AR8MSWIN1256
export ORACLE_BASE ORACLE_HOME NLS_LANG ORACLE_SID
PATH=/usr/bin:/etc:/usr/sbin:/usr/local/bin:/usr/local/sbin:$ORACLE_HOME/bin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:.
export PATH ORACLE_HOME ORACLE_BASE ORACLE_SID
status=`ps -ef |grep -v grep |grep smon |awk -F"_" '{print $3}'`
alias pcl="tail -f /home/oracle/kaleem/audit/power_crash_$$.log"
#if [ "$status" == "$ORACLE_SID" ]; then
if ["$status"="$ORACLE_SID"]; then
echo " Database : $ORACLE_SID is already running "
else
echo " Please wait until db is open and follow the instructions printing down."
echo
echo "open a new terminal with `whoami`/`whoami` and run "al" "
echo
echo "open another termial with `whoami`/`whoami` and run "pclog" "
echo
sleep 20
echo
echo
sh /home/oracle/kaleem/admin/recover_crash_aix.sh
echo
echo " The details log file you can be seen here"
echo "location : /home/oracle/kaleem/audit/power_crash_$$.log"
echo
echo "---------------- Finished ----------------"
fi
$ sh pc.sh
+ ORACLE_BASE=/u01/app/oracle
+ ORACLE_HOME=/u01/app/oracle/product/101
+ ORACLE_SID=yscc02
+ NLS_LANG=AMERICAN_AMERICA.AR8MSWIN1256
+ export ORACLE_BASE ORACLE_HOME NLS_LANG ORACLE_SID
+ PATH=/usr/bin:/etc:/usr/sbin:/usr/local/bin:/usr/local/sbin:/u01/app/oracle/product/101/bin:/usr/ucb:/home/oracle/bin:/usr/bin/X11:/sbin:.
+ export PATH ORACLE_HOME ORACLE_BASE ORACLE_SID
+ + ps -ef
+ grep smon
+ grep -v grep
+ awk -F_ {print $3}
status=yscc02
+ alias pcl=tail -f /home/oracle/kaleem/audit/power_crash_544818.log
+ [yscc02 =yscc02]
pc.sh[21]: [yscc02 =yscc02]: not found.
+ echo Please wait until db is open and follow the instructions printing down.
Please wait until db is open and follow the instructions printing down.
+ echo
+ whoami
+ whoami
+ echo open a new terminal with oracle/oracle and run al
open a new terminal with oracle/oracle and run al
+ echo
+ whoami
+ whoami
+ echo open another termial with oracle/oracle and run pclog
open another termial with oracle/oracle and run pclog
+ echo
+ sleep 20
^C$
Last edited by Franklin52; 09-20-2012 at 04:50 AM..
Reason: Please use code tags for data and code samples
Hello everyone,
I am having problems figuring this out.
This script below is supposed to create a list of file names with their "md5sum", in a file "lib-list.txt"
When I run it "sh component-list.sh " I get this:component-list.sh: 4: component-list.sh: function: not found
component-list.sh:... (4 Replies)
Hello All,
I am running source command on my project configuration file app.cfg which has conditional statements with make file systax E.g ifeq ($(APP_CMP_DIR),trunk).
When I source this file it throws error: syntax error near unexpected token... (1 Reply)
Hi All
I would like to profile my application with oprofile but I can't since no samples are collected.
The kernel of my app is 2.6 on RED HAT Enterprise 5.3 (Tikanga) so OProfile is setup in timer interrupt mode
# opcontrol --list-events
Using timer interrupt.
I... (0 Replies)
HP rp5450 (L2000)
running HP-UX 11.11B
Using DLT 7000 and DLT 4000 tape drives for nightly full backups
Backup jobs created by SAM
DLT 7000 cron entry is as follows:
00 2 * * 1-6 /usr/sam/lbin/br_backup DLT FULL Y /dev/rmt/0m /var/sam/graphLCAa17036 root Y 1 N > /var/sam/SAM_br_msgs 2>&1... (1 Reply)
Hi,
I am using following code to send an e-mail with attachment and body.
echo "To: user1@mail.com,user2@mail.com" > mail.tmp
echo "Cc: user3@mail.com,user4@mail.com" >> mail.tmp
echo "From: group@mail.com" >> mail.tmp
echo "Subject: my report" >> mail.tmp
echo "please see as attached"... (6 Replies)
Why do I get the error on the second example?.
This works:
if ];then
> echo "true"
> else
> echo "false"
> fi
true
This doesn't, and gets the error shown:
if ];then
> b=1
> else
> b=0
> fi
-ksh93: line 2: .
b=1: not found. (1 Reply)
I'm trying to install Redhat LInux AS 4 update 4 on an IBM x306 series server. I keep getting following error:
"No Drives Found. An error has occurred - no valid devices were found on which to create new file systems. Please check your hardware for the cause of this problem."
I called IBM and... (2 Replies)
I recently got this new old server from a friend. I just installed a fresh version of Solaris 10 on it. I have put a static IP of 192.168.100.10 the server. Their is no subnetting scheme on the network. And I made the hostname "SunServ." And I also changed the folder "/etc/inet/hosts" because I... (4 Replies)