Sponsored Content
Top Forums Shell Programming and Scripting If statement failing with error "pc.sh[21]: [yscc02 =yscc02]: not found." Post 302703585 by javeedkaleem on Thursday 20th of September 2012 03:47:32 AM
Old 09-20-2012
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

----------------------------------------
script failed message:
-----------------------------------
Code:
$ 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
 

9 More Discussions You Might Find Interesting

1. Solaris

Network Path Not Found Error "Sunfire V100"

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)
Discussion started by: louisd11
4 Replies

2. UNIX for Dummies Questions & Answers

why emacs caused "command not found" error

I installed Red Hat Enterprise Linux 5 on my PC. When i typed 'emacs' on the console, "command not found" error occurrd. Why. :mad: (1 Reply)
Discussion started by: cy163
1 Replies

3. Red Hat

"No Drives Found" error during Redhat Linux AS 4 installation

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)
Discussion started by: pieman8080
2 Replies

4. Shell Programming and Scripting

ksh93 if statement gives "not found" error

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)
Discussion started by: R.T.
1 Replies

5. Shell Programming and Scripting

sendmail script throwing an error "No recipient addresses found in header"

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)
Discussion started by: vivek_damodaran
6 Replies

6. HP-UX

DLT 7000 tape drive failing with "write error on a record in the index"

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)
Discussion started by: dreh99
1 Replies

7. Red Hat

Could interrupt disabled cause "opreport error: No sample file found"?

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)
Discussion started by: manustone
0 Replies

8. Shell Programming and Scripting

Source command returns error when it strikes conditional statement "ifeq"

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)
Discussion started by: anand.shah
1 Replies

9. Shell Programming and Scripting

Bash script fails with "function: not found" error

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)
Discussion started by: joemb
4 Replies
echo(3XCURSES)						  X/Open Curses Library Functions					    echo(3XCURSES)

NAME
echo, noecho - enable/disable terminal echo SYNOPSIS
cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib -R /usr/xpg4/lib -lcurses [ library... ] c89 [ flag... ] file... -lcurses [ library... ] #include <curses.h> int echo(void); int noecho(void); DESCRIPTION
The echo() function enables Echo mode for the current screen. The noecho() function disables Echo mode for the current screen. Initially, curses software echo mode is enabled and hardware echo mode of the tty driver is disabled. The echo() and noecho() functions control soft- ware echo only. Hardware echo must remain disabled for the duration of the application, else the behavior is undefined. RETURN VALUES
Upon successful completion, these functions return OK. Otherwise, they return ERR. ERRORS
No errors are defined. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
getch(3XCURSES), getstr(3XCURSES), initscr(3XCURSES), libcurses(3XCURSES), scanw(3XCURSES), attributes(5), standards(5) SunOS 5.11 5 Jun 2002 echo(3XCURSES)
All times are GMT -4. The time now is 12:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy