?
Solved

error  is not an identifier in shell script

Posted on 2007-10-19
16
Medium Priority
?
13,418 Views
Last Modified: 2008-01-09
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
0
Comment
Question by:parlepoint
16 Comments
 
LVL 85

Expert Comment

by:ozo
ID: 20111442
how are you using $PVT_Config in your script?
0
 
LVL 85

Expert Comment

by:ozo
ID: 20111456
did you say
export PVT_Config
or
export $PVT_Config
0
 

Author Comment

by:parlepoint
ID: 20111646
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...
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 85

Expert Comment

by:ozo
ID: 20111681
can you post an example of a script that exhibits those symptoms
0
 

Author Comment

by:parlepoint
ID: 20111769
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
0
 
LVL 85

Expert Comment

by:ozo
ID: 20111899
Where did you set PVT_LOC_CONFIG?  dies it have any relationship to $PVT_Config ?
0
 

Author Comment

by:parlepoint
ID: 20111943
PVT_config is example of PVT_LOC_CONFIG..

that i am reading from txt.file.
0
 
LVL 85

Expert Comment

by:ozo
ID: 20111969
can post a script that shows an example of what you mean?
0
 
LVL 48

Expert Comment

by:Tintin
ID: 20113934
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

0
 
LVL 40

Accepted Solution

by:
omarfarid earned 75 total points
ID: 20113981
Hi,

+ export /qual/ssm/stat/current/config
/usr/bin/ksh[242]: /qual/ssm/stat/current/config: is not an identifier

The above lines are taken from the initial post of the question, and it sounds that the problem is as Tintin recommended.

This is because:

if you have a script a.sh like this:

PVT_Config=/qual/ssm/stat/current
echo $PVT_Config
export $PVT_Config

and you

sh -x a.sh
+ PVT_Config=/qual/ssm/stat/current
+ echo /qual/ssm/stat/current
/qual/ssm/stat/current
+ export /qual/ssm/stat/current
a.sh: export: `/qual/ssm/stat/current': not a valid identifier


0
 
LVL 85

Expert Comment

by:ozo
ID: 20114012
That's why I asked how PVT_Config was being used
was it
export PVT_Config
or
export $PVT_Config
0
 

Author Comment

by:parlepoint
ID: 20122889
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
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 20122964
cd "$PVT_LOC_CONFIG"/javaserver/com/fedex/common/security_framework
0
 

Author Comment

by:parlepoint
ID: 20123082
same error is coming...
0
 
LVL 85

Assisted Solution

by:ozo
ozo earned 75 total points
ID: 20124205
echo $PVT_LOC_CONFIG
export PVT_LOC_CONFIG
print "=========$PVT_LOC_CONFIG======"

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


output:
PVT_LOC_CONFIG=/qual/ssm/stat/config
cd /javaserver/com/fedex/common/security_framework

Something else is wrong
where is the output of
echo $PVT_LOC_CONFIG
print "=========$PVT_LOC_CONFIG======"

and how did
cd /javaserver/com/fedex/common/security_framework
get output?

cd $PVT_LOC_CONFIG/javaserver/com/fedex/common/security_framework
does not echo

are you sure the
PVT_LOC_CONFIG="$( grep '^ProjectLocation=' temp.txt )" ;
is finding ^ProjectLocation=?
0
 

Author Comment

by:parlepoint
ID: 20124724
i found the problem..
it in txt file...having space after last destination.

Thanks
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question