update the code to get the last char of path

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7866 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
mxi1 2010-10-15 09:45:20 +00:00
parent b841208705
commit 9ade4a4125

View File

@ -258,13 +258,14 @@ FindFile () {
# ex. /.statelite/mnt/10.2.0.200/etc/FScfg
# ex. /.statelite/mnt/10.2.0.200/root/ssh/
if [ -e ${SRC} ]; then
PATHEND=`expr ${#path} - 1` # get the last char of the path
if [ ${path[${PATHEND}]} -ne '/' ] && [ -d ${SRC} ]; then
PATHEND=${#path}
CHAREND=`echo ${path} |cut -c${PATHEND}`
if [ ${CHAREND} -ne '/' ] && [ -d ${SRC} ]; then
FOUND=0
continue
fi
if [ ${path[${PATHEND}]} -eq "/" ] && [ -f ${SRC} ]; then
if [ ${CHAREND} -eq "/" ] && [ -f ${SRC} ]; then
FOUND=0
continue
fi