ksh? ksh? we don't need no steenking korn shell!
hello fellow linux users :)
first, i'm new, and second, i need to bug you all with a question that i can't seem to figure out... got an open ear? if for some reason asking a question like this is not allowed here, please let me know with one polite reply and i'll remove my post :) thanks!
it's mostly a question about how to run a script that's written to be used with ksh....
so, here's the issue atm....
I'll try to be as descriptive as possible...
I'm running RedHat 7.3, and I'm trying to install an 'extender' for Ibm's DB2 (which is already fully installed and functional), the extender i'm installing is called "DB2 XML Extender" (if you care, it can bring XML/DTD documents into a database's table and turn a table into a DTD and XML doc, kind of neat) now...
I got the RPM to install AOK, but... there's some post installation steps that need to be done to get the extender working.
The first of these steps is to run this particular script..... called "xmlicrt" (see end of document to check out the script) and...
here's the problems... first, check out the first line of the script...
#!/usr/bin/ksh
Ok, i'm not a shell guru, but, i know that ksh is a shell, the 'korn shell' and after installing pdksh on my machine, i realized that i already had KSH installed, but, ksh is NOT at /usr/bin/ksh, it's at /bin/ksh -- soooo... i tried changed the line accordingly.
here's the error...
i run:
[db2inst1@localhost bin]$ ./xmlicrt
bash: ./xmlicrt: /bin/ksh: bad interpreter: Permission denied
so, i tried running 'chsh' to change to using the korn shell... here's what i did, and what happened...
[db2inst1@localhost bin]$ chsh -s /bin/ksh
Changing shell for db2inst1.
Password:
Shell changed.
[db2inst1@localhost bin]$ ./xmlicrt
bash: ./xmlicrt: /bin/ksh: bad interpreter: Permission denied
soooooooooo.... i switched back to bash and i started thinking "ok, these files belong to root, let's chown them to db2inst1" -- same thing happend.
so i still can't run the script :( i dunno if you guys have any ideas of things for me to try, or maybe can help explain to me some of this "korn" below so that i can do it manually, sorta looks like it's pretty simple stuff that this little script is performing....
the main thing i don't understand in the script is the "ln" command.... hrmphrm.
thanks for any input, and thanks again for even reading this far :)
xmlicrt_________________________________ __
#!/usr/bin/ksh
DXXDIR="/usr/IBMdb2xml/V7.1"
INSTHOME=$HOME
cd
#check if $HOME/dxx exists
#if not create $HOME/dxx
if [ ! -d ${INSTHOME?}/dxx ]; then
mkdir -p ${INSTHOME?}/dxx
fi
ln -fs ${DXXDIR?}/bin ${INSTHOME?}/dxx/bin
ln -fs ${DXXDIR?}/bnd ${INSTHOME?}/dxx/bnd
#copy template of dxxprofile from root source to
# to ${INSTHOME?}/dxx
cp ${DXXDIR?}/bin/dxxprofile ${INSTHOME?}/dxx
cd ${INSTHOME?}/sqllib/function
ln -fs ${DXXDIR?}/lib/db2xml db2xml
ln -fs ${DXXDIR?}/lib/db2xmlfn db2xmlfn
_____________________________________
first, i'm new, and second, i need to bug you all with a question that i can't seem to figure out... got an open ear? if for some reason asking a question like this is not allowed here, please let me know with one polite reply and i'll remove my post :) thanks!
it's mostly a question about how to run a script that's written to be used with ksh....
so, here's the issue atm....
I'll try to be as descriptive as possible...
I'm running RedHat 7.3, and I'm trying to install an 'extender' for Ibm's DB2 (which is already fully installed and functional), the extender i'm installing is called "DB2 XML Extender" (if you care, it can bring XML/DTD documents into a database's table and turn a table into a DTD and XML doc, kind of neat) now...
I got the RPM to install AOK, but... there's some post installation steps that need to be done to get the extender working.
The first of these steps is to run this particular script..... called "xmlicrt" (see end of document to check out the script) and...
here's the problems... first, check out the first line of the script...
#!/usr/bin/ksh
Ok, i'm not a shell guru, but, i know that ksh is a shell, the 'korn shell' and after installing pdksh on my machine, i realized that i already had KSH installed, but, ksh is NOT at /usr/bin/ksh, it's at /bin/ksh -- soooo... i tried changed the line accordingly.
here's the error...
i run:
[db2inst1@localhost bin]$ ./xmlicrt
bash: ./xmlicrt: /bin/ksh: bad interpreter: Permission denied
so, i tried running 'chsh' to change to using the korn shell... here's what i did, and what happened...
[db2inst1@localhost bin]$ chsh -s /bin/ksh
Changing shell for db2inst1.
Password:
Shell changed.
[db2inst1@localhost bin]$ ./xmlicrt
bash: ./xmlicrt: /bin/ksh: bad interpreter: Permission denied
soooooooooo.... i switched back to bash and i started thinking "ok, these files belong to root, let's chown them to db2inst1" -- same thing happend.
so i still can't run the script :( i dunno if you guys have any ideas of things for me to try, or maybe can help explain to me some of this "korn" below so that i can do it manually, sorta looks like it's pretty simple stuff that this little script is performing....
the main thing i don't understand in the script is the "ln" command.... hrmphrm.
thanks for any input, and thanks again for even reading this far :)
xmlicrt_________________________________
#!/usr/bin/ksh
DXXDIR="/usr/IBMdb2xml/V7.1"
INSTHOME=$HOME
cd
#check if $HOME/dxx exists
#if not create $HOME/dxx
if [ ! -d ${INSTHOME?}/dxx ]; then
mkdir -p ${INSTHOME?}/dxx
fi
ln -fs ${DXXDIR?}/bin ${INSTHOME?}/dxx/bin
ln -fs ${DXXDIR?}/bnd ${INSTHOME?}/dxx/bnd
#copy template of dxxprofile from root source to
# to ${INSTHOME?}/dxx
cp ${DXXDIR?}/bin/dxxprofile ${INSTHOME?}/dxx
cd ${INSTHOME?}/sqllib/function
ln -fs ${DXXDIR?}/lib/db2xml db2xml
ln -fs ${DXXDIR?}/lib/db2xmlfn db2xmlfn
_____________________________________
