Hello,
In a Bourne shell script I am calling an include file where I am trying to add the ability of the called script to act upon parameters being passed.
The include script runs OK by itself being called from the command line but not when being called from within my parent script. It does not seem to be getting the parameters or setting\exporting the variable.
Parent Script
initVars.sh (this works fine being executed by itself)
What can you suggest?
Thanks,
Michael42
In a Bourne shell script I am calling an include file where I am trying to add the ability of the called script to act upon parameters being passed.
The include script runs OK by itself being called from the command line but not when being called from within my parent script. It does not seem to be getting the parameters or setting\exporting the variable.
Parent Script
Code:
#!/bin/sh
. /mypath/initVars.sh DB1
[COLOR=green]# The value of this is set in initVars.sh
# but is empty when running from this script.[/color]
echo $MYDB
initVars.sh (this works fine being executed by itself)
Code:
#!/bin/sh
# Usage: initVars.sh <db_name>
# Example: initVars.sh DB1
MYDB="$1"
export MYDB
echo $MYDB
What can you suggest?
Thanks,
Michael42