Is not a identifier error


 
Thread Tools Search this Thread
Operating Systems Solaris Is not a identifier error
# 1  
Old 12-13-2011
Data Is not a identifier error

Hi

I am trying to execute a script. I have solaris 10, After i login i will toggle to BASH.

The script tried to set a variable called CARBON_HOME. Even i tried to set it manually. But still it is saying the following error.Smilie

" CARBON_HOME=/usr/wso2/wso2esb-4.0.0: is not an identifier "

Please help out.

Regards
Guru
# 2  
Old 12-13-2011
Since you haven't given any details of the script in question it's hard to offer any advice...
# 3  
Old 12-13-2011
Script which issues identifier error

Quote:
Originally Posted by CarloM
Since you haven't given any details of the script in question it's hard to offer any advice...
Hi Carlo,

This is the script .
Code:
cygwin=false;
darwin=false;
os400=false;
mingw=false;
case "`uname`" in
CYGWIN*) cygwin=true;;
MINGW*) mingw=true;;
OS400*) os400=true;;
Darwin*) darwin=true
        if [ -z "$JAVA_VERSION" ] ; then
             JAVA_VERSION="CurrentJDK"
           else
             echo "Using Java version: $JAVA_VERSION"
           fi
           if [ -z "$JAVA_HOME" ] ; then
             JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home
           fi
           ;;
esac

# resolve links - $0 may be a softlink
PRG="$0"

while [ -h "$PRG" ]; do
  ls=`ls -ld "$PRG"`
  link=`expr "$ls" : '.*-> \(.*\)$'`
  if expr "$link" : '.*/.*' > /dev/null; then
    PRG="$link"
  else
    PRG=`dirname "$PRG"`/"$link"
  fi
done

# Get standard environment variables
PRGDIR=`dirname "$PRG"`

# Only set CARBON_HOME if not already set
[ -z "$CARBON_HOME" ] && CARBON_HOME=`cd "$PRGDIR/.." ; pwd`

# Set AXIS2_HOME. Needed for One Click JAR Download
AXIS2_HOME=$CARBON_HOME

# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin; then
  [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
  [ -n "$CARBON_HOME" ] && CARBON_HOME=`cygpath --unix "$CARBON_HOME"`
  [ -n "$AXIS2_HOME" ] && CARBON_HOME=`cygpath --unix "$CARBON_HOME"`
fi

# For OS400
if $os400; then
  # Set job priority to standard for interactive (interactive - 6) by using
  # the interactive priority - 6, the helper threads that respond to requests
  # will be running at the same priority as interactive jobs.
  COMMAND='chgjob job('$JOBNAME') runpty(6)'
  system $COMMAND

  # Enable multi threading
  QIBM_MULTI_THREADED=Y
  export QIBM_MULTI_THREADED
fi

# For Migwn, ensure paths are in UNIX format before anything is touched
if $mingw ; then
  [ -n "$CARBON_HOME" ] &&
    CARBON_HOME="`(cd "$CARBON_HOME"; pwd)`"
  [ -n "$JAVA_HOME" ] &&
    JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
  [ -n "$AXIS2_HOME" ] &&
    CARBON_HOME="`(cd "$CARBON_HOME"; pwd)`"
  # TODO classpath?
fi

Regards
Guru

Last edited by Scott; 12-13-2011 at 09:48 AM.. Reason: Please use code tags
# 4  
Old 12-13-2011
Switch your script to use /bin/ksh (or bash) but not /bin/sh. You are using a syntax not supported by Solaris legacy /bin/sh.

If for some reason you want to stay with /bin/sh, replace:
Code:
export CARBON_HOME=/usr/wso2/wso2esb-4.0.0:

by
Code:
export CARBON_HOME
CARBON_HOME=/usr/wso2/wso2esb-4.0.0:

# 5  
Old 12-13-2011
Also, possibly a logic error (twice):
Code:
[ -n "$AXIS2_HOME" ] && CARBON_HOME=`cygpath --unix "$CARBON_HOME"`

Shouldn't this (re)set AXIS2_HOME, not CARBON_HOME?

Last edited by CarloM; 12-13-2011 at 09:47 AM..
# 6  
Old 12-13-2011
Solaris issue resolved

Quote:
Originally Posted by jlliagre
Switch your script to use /bin/ksh (or bash) but not /bin/sh. You are using a syntax not supported by Solaris legacy /bin/sh.

If for some reason you want to stay with /bin/sh, replace:
Code:
export CARBON_HOME=/usr/wso2/wso2esb-4.0.0:

by
Code:
export CARBON_HOME
CARBON_HOME=/usr/wso2/wso2esb-4.0.0:

Hi Carlo and Jlliagre,

Thanks. I went inside the script and replaced /bin/sh with /bin/bash . Now it works. Thanks a lot.

Regards
Guru
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Compilation Error--Undeclared Identifier

Hello, I am trying to install BBFTP software on my Mac (OS X), and am running into some compilation errors. Here is the code, the specific errors are listed after: #include <dirent.h> #include <errno.h> #include <fnmatch.h> #include <netinet/in.h> #include <syslog.h> #include <sys/stat.h>... (1 Reply)
Discussion started by: Tyler_92
1 Replies

2. Shell Programming and Scripting

error while extracting a line from a file based on identifier

here is the content of input file CREATE TABLE `bla bla bla` ( `allianceSiteId` int(11) DEFAULT NULL, `trunkGroupsId` int(11) DEFAULT NULL, `lastModified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, UNIQUE KEY `allianceSiteId`... (4 Replies)
Discussion started by: vivek d r
4 Replies

3. Shell Programming and Scripting

Identifier issue

Hi, We are in the process of migrating our servers from Solaris to AIX. During our testing phase, while we are testing the scripts(reccnt.int), we are getting the following error during execution: /reccnt.int: a:fname:b:dte:tme:eqind:norecs:cntr:c:d:e:f: is not an identifier It is... (6 Replies)
Discussion started by: pyaranoid
6 Replies

4. UNIX for Advanced & Expert Users

ORACLE_SID= ...: is not an identifier

Hello All, On My solaris 5.10 SPARC, i am always having problems setting my Oracle variables. even if it exists in the .profile file. below is an example $ export ORACLE_SID=test ORACLE_SID=test: is not an identifier even that the echo is returning the variable $ echo $ORACLE_SID... (3 Replies)
Discussion started by: beayni33
3 Replies

5. Shell Programming and Scripting

is not an identifier

Hi Guys... I am using the following codes in my script: SID_L=`cat /var/opt/oracle/oratab|grep -v "^#"|cut -f1 -d: -s` SID_VAR=$SID_L for SID_RUN in $SID_VAR do ORACLE_HOME=`grep ^$SID_RUN /var/opt/oracle/oratab | \ awk -F: '{print $2}'` ;export ORACLE_HOME export... (2 Replies)
Discussion started by: Phuti
2 Replies

6. Shell Programming and Scripting

is not an identifier error

Hi gurus, I am trying to execute a shell script which connects to the oracle db and get the values from a table and then it exports the values on UNIX. For this, I am creating a temp file which stores the values returned from the select query and then executes this file. Below is the code which... (13 Replies)
Discussion started by: svajhala
13 Replies

7. Shell Programming and Scripting

not an identifier

Hi I have already gone through this topic on this forum, but still i am getting same problem. I am using solaris 10. my login shell is /usr/bash i have got a script as below /home/gyan> cat 3.cm #!/usr/bin/ksh export PROG_NAME=rpaa001 if i run this script as below , it works fine... (3 Replies)
Discussion started by: gyanibaba
3 Replies

8. Solaris

-sh: is not an identifier

Hi , I am getting the following message when log into my unix account in sun solaris (version5.9)server. -sh: ORACLE_HOME=/apps/oracle/product/10.2.0/client_1: is not an identifier The ORACLE_HOME is set in .profile file. Another thing is that SID is also set inside .profile like... (4 Replies)
Discussion started by: megh
4 Replies

9. Shell Programming and Scripting

': not a valid identifier

I am trying to write a bash script. I am able to do simple things like pass arguments, assign variables and echo the results. However, when I try to declare and array or anything a little more complicated I get ': not a valid identifier Here is my code so far: #!/bin/bash echo start t... (7 Replies)
Discussion started by: script123
7 Replies

10. Shell Programming and Scripting

Getting is not an identifier error

Hi all, I am getting this error while setting CLASSPTH using a script my script is #!bin/ksh export CLASSPATH=$CLASSPATH:<some path>:<some path> If i do this thing on shell prompt individually it is working fine. but while using in shell script it is giving error. better if you... (12 Replies)
Discussion started by: swat
12 Replies
Login or Register to Ask a Question