Export error
Hi,
Let me start by saying I am a complete noob to Linux. I am trying to run a shell script which USED to run under Unix. I have everything commented out except "cd /cloverleaf/qdx5.4.1/integrator". I know this exists because I can get to it on the command line. When I execute the script I get: : No such file or directory: line 25: cd: /cloverleaf/qdx5.4.1/integrator The vendor hasn't been much help. They told me I needed to set and enviroment variable and sent me the following to place in my script. /usr/bin/ksh -c `export QUOVADX_INSTALL_DIR=/cloverleaf/qdx5.4.1/integrator/sbin/hcisetenv -root ksh /cloverleaf/qdx5.4.1/integrator` imphp When I run this in the script I get: ./CERNER_USAGE_PROCESS_TEST: line 1: export: `-root': not a valid identifier ./CERNER_USAGE_PROCESS_TEST: line 1: export: `/cloverleaf/qdx5.4.1/integrator': not a valid identifier : not foundh: imphp Any help would be appreciated, Tim |
It would help to see the script. If it is a Korn shell (ksh) script, those with the knowledge of ksh could help. If is a Unix Bourne shell (sh), folks with knowledge of sh/bash scripting could help.
|
There is a link from ksh to bash and I can get to it from the command line, however when the first line executes, I get:
-bash-2.05b$ ./CERNER_USAGE_PROCESS_TEST : bad interpreter: No such file or directory/ksh Here's the script. Most of it has been commented out, but I can't even get past the #!/usr/bin/ksh #! /usr/bin/ksh #******************************** # CERNER_USAGE_PROCESS_TEST # # Created by : Tim Hallbauer # Date: 02/02/06 # Modified: # #******************************** # #******************** # Stop the thread * #******************** #setroot #setsite smc_development # #hcicmd -p surginet_usage -c 'CER_LAW_USAGE pstop' # #/usr/bin/ksh -c `export QUOVADX_INSTALL_DIR=/cloverleaf/qdx5.4.1/integrator/sbin/hcisetenv -root ksh /cloverleaf/qdx5.4.1/integrator` imphp # #*************************************** # Change to the directory the file is * # in and fix it. (remove the extra \n) * #*************************************** # cd /cloverleaf/qdx5.4.1/integrator # #tr -d '\015' < CERNER_USAGE_TEMP > FFINVTRANSWK # #************************************************* # Change to the directory where we want the file * # to reside on Lawson and begin the FTP process * #************************************************* # #ftp -n -i << EOP # open IP # user name pwd # cd /law8B/apps/test/hht # type binary # put FFINVTRANSWK # site chmod 777 FFINVTRANSWK #quit #EOP # #********************** # Backup and delete * #********************** # #cp FFINVTRANSWK FFINVTRANSWK_BKP #cp CERNER_USAGE_TEMP CERNER_USAGE_TEMP_BKP #rm CERNER_USAGE_TEMP # #********************* # Start CER_LAW_USAGE * #********************* #hcicmd -p surginet_usage -c 'CER_LAW_USAGE pstart' # |
Got it figured out after some digging. I found a similar post and thought about how the script was created. It was copied and pasted from a text editor which caused the code to have carriage returns at the end of each line. I re-keyed the script in vi and now it runs just like it used to.
Thanks for helping. |
All times are GMT -5. The time now is 03:18 AM. |