Skip to content
Snippets Groups Projects
Commit 34c402db authored by Simon Rose's avatar Simon Rose
Browse files

Added preload of env.sh and fix -l flag

parent 0111e844
No related branches found
No related tags found
No related merge requests found
......@@ -55,6 +55,16 @@ declare -r TMP_PATH="/tmp/systemd-private-e3-iocsh-$(whoami)"
. ${SC_TOP}/iocsh_functions
# To get the absolute path where iocsh.bash is executed
IOCSH_TOP=${PWD}
# Load any environment variables
if [ -f "$IOCSH_TOP/env.sh" ]; then
echo "Loading environment variables from $IOCSH_TOP/env.sh"
source "$IOCSH_TOP/env.sh"
fi
BASECODE="$(basecode_generator)"
check_mandatory_env_settings
......@@ -76,9 +86,6 @@ REQUIRE_IOC=$(require_ioc "${iocsh_bash_id}")
mkdir -p ${TMP_PATH}
IOC_STARTUP=$(mktemp -p ${TMP_PATH} -q --suffix=_iocsh_${SC_VERSION}) || die 1 "${SC_SCRIPTNAME} CANNOT create the startup file, please check the disk space";
#
# To get the absolute path where iocsh.bash is executed
IOCSH_TOP=${PWD}
# EPICS_DRIVER_PATH defined in iocsh and startup.script_common
# Remember, driver is equal to module, so EPICS_DRIVER_PATH is the module directory
......
......@@ -397,7 +397,7 @@ function loadFiles
loadFiles $(cat ${file#@})
;;
( *=* )
echo -n $file | awk -F '=' '{printf "epicsEnvSet %s '\''%s'\''\n", $1, $2}'
echo -n $file | awk -F '=' '{printf "epicsEnvSet %s '\''%s'\''\n" $1 $2}'
;;
( -c )
shift
......@@ -428,7 +428,8 @@ function loadFiles
;;
( -l )
shift
printf "epicsEnvSet EPICS_DRIVER_PATH %s:${EPICS_DRIVER_PATH}\n", $1
printf "epicsEnvSet EPICS_DRIVER_PATH %s:${EPICS_DRIVER_PATH}\n" $1
EPICS_DRIVER_PATH="$1:$EPICS_DRIVER_PATH"
;;
( -dg )
shift
......@@ -481,7 +482,7 @@ function loadFiles
if [[ ${BASECODE} -ge 03150002 ]]; then
echo "iocshLoad '$file','$subst'"
else
echo -n $subst | awk -F '=' -v 'RS=,' '{printf "epicsEnvSet %s '\''%s'\''\n", $1, $2}'
echo -n $subst | awk -F '=' -v 'RS=,' '{printf "epicsEnvSet %s '\''%s'\''\n" $1 $2}'
echo "< '$file'"
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment