cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
shradha
Level 3

how to use Installanywhere variable in Exceute shell script action

I use Execute script/Batch action under install tab
I provide the script but my script is not able to resolve the installanwyhere variable $USER_ISNATLL_DIR$.How to use it.
Below is my script
#!/usr/bin/bash
x='isainfo -kv'
if [ "$x"="64-bit amd64 kernel modules" ];then
pkgadd -n -a $USER_INSTALL_DIR$$\$admin.txt -d $USER_INSTALL_DIR$$\$solaris$\$i386$\$64bit$\$bfa_pkg all


#pkgadd -n -a /opt/brocade/hcm/admin.txt -d /opt/brocade/hcm/solaris/i386/64bit/bfa_pkg all
else
if [ "$x"="32-bit i386 kernel modules" ];then
pkgadd -n -a $USER_INSTALL_DIR$$\$admin.txt -d $USER_INSTALL_DIR$$\$solaris$\$i386$\$32bit$\$bfa_pkg all
fi
fi

however if i use absolute path like
pkgadd -n -a /opt/brocade/hcm/admin.txt -d /opt/brocade/hcm/solaris/i386/64bit/bfa_pkg all
it works fine.
I am runnnning on solaris x86 32 bit and 64 bit platforms.

How does script resolve installanwyhere variable
I use show message dialog to display if above files are found and i get teh appropriate out put that both files are found.
Only in shell script there seems to be problem .
Any help is greatly appreciated

Thanks
Shradha
Labels (1)
0 Kudos

(4) Replies
shradha
Level 3

I kind of figured ou the problem.
SO script would not be able to resolve $USER_INSTALL_DIR$ variable
So I use action
set System environment variable
before my execute script action
and i do
Variable Name INSTALL_AT
Set value To $USER_INSTALL_DIR$

Script goes as follows
#!/usr/bin/bash
x='isainfo -kv'
if [ "$x"="64-bit amd64 kernel modules" ];then
pkgadd -n -a $INSTALL_AT/admin.txt -d $INSTALL_AT/bfa_pkg all
#pkgadd -n -a /opt/brocade/hcm/admin.txt -d /opt/brocade/hcm/solaris/i#386/64bit/bfa_pkg all
else
if [ "$x"="32-bit i386 kernel modules" ];then
pkgadd -n -a $INSTALL_AT/admin.txt -d $INSTALL_AT/solaris/i386/32bit/bfa_pkg all
fi
fi


I run the installer but no environment variable is set
since my system is amd 64 i expect first if to execute
after the installation i check
echo $INSTALL_AT
but get nothing
so Install anywher is not able to set environment variable


Why is the set system environment variable not working

Any help is greatly appreciated
0 Kudos
jerome_IA
Level 9

While looking at your script in the first post, I noticed the variable "x" is not set like it should.

If you want to have "$x" written in your script, you need to define it as "$DOLLAR$x"
if [ "$DOLLAR$x"="64-bit ...etc...

In IA, variable DOLLAR is resolved as $.

BR
0 Kudos
shradha
Level 3

Hi Jerome_IA
Thanks for your response and pointing out teh orrection ins cript.. I will amke this cahnge of using $DOLLAR$.
I found the soultion to my problem in following way
1.use Installanwyeher variable in script say $USER_INSTALL_DIR$
2.use action modify text file
procide your script file and choose option "subsitute vale for installnwyehe variable"
3. use execute command action
sh script1.sh

this will atke care of the problem.No "set system environment variable" action is needed
0 Kudos
james_decosta
Level 9

hi shradha,
the modify text file action in the script is a kind of workaround which even i do use in my scripts but i wish the refresh environment action to take place and for this the refresh.dll should work efficiently.
I am trying to achieve this and once i am done shall contribute to accresso installanywhere 9.0 or so.
Even any other member of this group can mail me and help me out in implementing this feature.
Best Regards,
James