Link to home
Start Free TrialLog in
Avatar of parlepoint
parlepoint

asked on

error is not an identifier in shell script

i am using $PVT_Config in my script..
when i do echo shows me value of variable but after that i am using in script won't work..even not allow me to export that value..

i try to export variable in script...but want allow me
+ echo /qual/ssm/stat/current/config
+ echo QAS
+ echo /qual/ssm/stat/current
+ export /qual/ssm/stat/current/config
/usr/bin/ksh[242]: /qual/ssm/stat/current/config: is not an identifier
Avatar of ozo
ozo
Flag of United States of America image

how are you using $PVT_Config in your script?
did you say
export PVT_Config
or
export $PVT_Config
Avatar of parlepoint
parlepoint

ASKER

i m using export PVT_config
after that i did
echo $PVT_config
print "$PVT_config"
it's printing...
=====
just after that i am given cd $PVT_config/a/b/c
that's not finding...
can you post an example of a script that exhibits those symptoms
echo $PVT_LOC_CONFIG
export PVT_LOC_CONFIG
print "=========$PVT_LOC_CONFIG======"

cd $PVT_LOC_CONFIG/javaserver/com/fedex/common/security_framework

 # INDIVIDUALLY ENCRYPT EACH PASSWORD PROJECT
 IFS="$CM_IFSDEFAULT"
   for PVT_PROPFILE in *.props
   do
    # * Obtain project name from properties file name
    PVT_PROJECT="${PVT_PROPFILE%.*}"
done
Where did you set PVT_LOC_CONFIG?  dies it have any relationship to $PVT_Config ?
PVT_config is example of PVT_LOC_CONFIG..

that i am reading from txt.file.
can post a script that shows an example of what you mean?
I'd be 99% certain the only case where you'd get the message "is not an identifier" is where you do

export $variable_name

eg:

$ echo $0
ksh
$ foo=abc:def
$ export $foo
ksh: abc:def: is not an identifier

ASKER CERTIFIED SOLUTION
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That's why I asked how PVT_Config was being used
was it
export PVT_Config
or
export $PVT_Config
sorry guys late reply..

=======================================
PVT_LOC_CONFIG="$( grep '^ProjectLocation=' temp.txt )" ; PVT_LOC_CONFIG="${PVT_LOC_CONFIG##*=}"
* reading pvt_loc_config from temp.txt file and excute...
echo $PVT_LOC_CONFIG
export PVT_LOC_CONFIG
print "=========$PVT_LOC_CONFIG======"

cd $PVT_LOC_CONFIG/javaserver/com/fedex/common/security_framework

 # INDIVIDUALLY ENCRYPT EACH PASSWORD PROJECT
 IFS="$CM_IFSDEFAULT"
   for PVT_PROPFILE in *.props
   do
    # * Obtain project name from properties file name
    PVT_PROJECT="${PVT_PROPFILE%.*}"
done


=======================

output:
PVT_LOC_CONFIG=/qual/ssm/stat/config
cd /javaserver/com/fedex/common/security_framework
(HERE IS PROBLEM...IS NOT TAKING VALUE OF $PVT_LOC_CONFIG)

hopefully now you guys understand where is problem..

Thanks
PP
cd "$PVT_LOC_CONFIG"/javaserver/com/fedex/common/security_framework
same error is coming...
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i found the problem..
it in txt file...having space after last destination.

Thanks