I'm working on porting one of the applications on the 'wiki wanted list' and I'm just missing why this isn't working. After translating all the linux inotify to kqueue you'd think this would be a snap, but I'm really rusty on sh scripting!
The following code works if I use /usr/local/bin/bash as the first line, but changing it to /bin/sh does not.
The error is
The following code works if I use /usr/local/bin/bash as the first line, but changing it to /bin/sh does not.
Code:
#!/bin/sh
#
# Check if dependencies are installed before build.
#
# Note:
# exiftool and ufraw-batch are not needed to build fotoxx,
# but they are required at run time to handle EXIF data
# and RAW files from digital cameras.
dlist=" g++ /usr/local/include/gtk-2.0/gtk/gtk.h
/usr/local/include/tiffio.h /usr/local/lib/libtiff.so
/usr/local/bin/xdg-open /usr/local/bin/xdg-desktop-menu /usr/local/bin/exiftool"
error=0
for dname in $dlist
do
if [ ${dname:0:1} = "/" ]
then find $dname >/dev/null 2>&1
else which $dname >/dev/null
fi
if [ $? -ne 0 ]; then error=1; fi
done
if [ $error -eq 0 ]
then echo "all dependencies found"
exit 0
fi
echo ""
echo "The following programs and libraries are required"
echo "(package names depend on your flavor of Linux)."
echo ""
echo "g++ the Gnu C++ compiler and linker"
echo "libgtk2.0-dev GTK graphics library (GUI base)"
echo "libtiff4-dev TIFF file support library"
echo "xdg-utils LSB standard Linux utilities"
echo "exiftool EXIF/IPTC image data read and write"
echo ""
for dname in $dlist
do
if [ ${dname:0} = "/" ]
then find $dname >/dev/null 2>&1
else which $dname >/dev/null
fi
if [ $? -ne 0 ]
then echo " missing: $dname"
else echo " found: $dname"
fi
done
The error is
Code:
./dependencies.sh: ${dname:1...}: Bad substitution