--- select.sh.orig 2010-07-07 09:49:45.000000000 -0600 +++ select.sh 2010-07-07 12:33:46.000000000 -0600 @@ -101,6 +101,17 @@ rm -f ${2} fi elif [ "ln" == "${1}" ]; then + # make sure the target directory exists: + # retrieve the directory path from ${3} + dir_path=`dirname ${3}` + if [ ! -e ${dir_path} ]; then + if [ 1 == "${noexec}" ]; then + echo "mkdir -p ${dir_path}" + else + mkdir -p ${dir_path} + fi + fi + # now that the target directory exists, create the link if [ 1 == "${noexec}" ]; then echo "ln -snf ${2} ${3}" else