I am facing this issue when concatenating strings Linux shell script
apphome="`cd \`dirname $0\` && pwd && cd - >/dev/null`"
echo "***************** APP Home***************"
echo $apphome
libdir="${apphome}/lib"
echo "**********Lib DIR ***********************"
echo ${libdir}
echo $apphome and echo $libdir gives following output
***************** APP Home***************
/product/abc/project1/cba/STADATA
**********Lib DIR ***********************
/libduct/abc/project1/cba/STADATA
why don’t it append /lib to the libdir correctly, could anybody explain me what is going wrong here
Just quote the string
Complete script
gives