This if statement:
if [ -n ${OSSIEHOME} ] && [ -d ${OSSIEHOME}/share/aclocal/ossie ]; then
OSSIE_AC_INCLUDE=${OSSIEHOME}/share/aclocal/ossie
else
echo "Error: Cannot find the OSSIE aclocal files. This is not expected!"
Constantly defaults to the error message. I know that OSSIEHOME has a value because if I do echo $OSSIEHOME from the command line I get
/usr/local/redhawk/core
And if I then hard code that path into my script it works fine. Problem is, I have a few other, much larger scripts where going through and hard coding the correct path isn't an option. What am I doing wrong?
Edit:
od -c <<<"$OSSIEHOME" gives me this:
0000000 / u s r / l o c a l / r e d h a
0000020 w k / c o r e \n
0000030
ls -l /usr/local/redhawk/core/share/aclocal/ gives me this:
drwxr-xr-x 2 root root 4096 Jul 19 10:02 ossie
Running the script with bash -x gives:
+ rm -f config.cache
+ '[' -e /usr/local/share/aclocal/libtool.m4 ']'
+ '[' -e /usr/share/aclocal/libtool.m4 ']'
+ /bin/cp /usr/share/aclocal/libtool.m4 acinclude.m4
+ libtoolize --force --automake
+ '[' -n ']'
+ '[' -d /share/aclocal/ossie ']'
+ echo 'Error: Cannot find the OSSIE aclocal files. This is not expected!'
Error: Cannot find the OSSIE aclocal files. This is not expected!
+ '[' -n ']'
+ aclocal -I
aclocal: error: option '-I' requires an argument
aclocal: Try '/bin/aclocal --help' for more information.
+ autoconf
+ automake --foreign --add-missing
I tried to export OSSIEHOME to make it global (just in case) but that didn't work. I then tried to run the script at . script.sh and source script.sh problem is I need to run the script with sudo or it won't have the necessary permissions to work. if I do though I get the error
sudo: source: command not found