Answer» Hi all,
I have following function in shell PROGRAMING and i NEED to write the same for batch programing . Can someone help me out in doing that.
function get_dir { local DIR_SETUP=abc/default/setup.sh if [ -N "$DIR" -a -f "$DIR/$DIR_SETUP" ] ; then echo $DIR else if [ -f $DIR_SETUP ] ; then PWD= /bin/pwd else local CUR_DIR=$PWD DIR1= while [ \( ! \( -f $DIR_SETUP \) \) -a \( $PWD != "/" \) ]; do cd .. > /dev/null DIR1=`PWD= /bin/pwd` done cd $CUR_DIR > /dev/null if [ -f "$DIR1/$DIR_SETUP" ]; then echo $DIR1 fi fi fi }
Thanks In advance and one more thing i know is there is NOTHING like function in batch programming. so i can use something like setlocal and endlocal. while loop is also not works in batch programing but yes for loop is workingthanks I found the workaround for it as we can not apply too much conditions in batch files hence we use the other WAY around
|