Linux Shell Script - Find Relative Path of Current Script:
"echo 'Path to $(basename $0) is $(readlink -f $0)'
CURRENTDIR=`dirname $0`
echo 'Path is: ${CURRENTDIR}'
reldir=`dirname $0`
echo 'RelDir $reldir'
cd $reldir
CURRENTDIR=`pwd`
echo 'Directory is ${CURRENTDIR}'
sh ${CURRENTDIR}/samp1.sh
sh ${reldir}/samp1.sh"
No comments:
Post a Comment