A simple shell question

Hi all...

here is my question: in the following, will the `cd $ref_ntp` work?

for i in `cat $fic`
do
{
       echo " "
echo ================$i=============================
OS=`$CMD -s $i "uname"`
case $OS in
SunOS)
ref_ntp=/ref/ntp/SUN
;;
HP-UX)
ref_ntp=/ref/ntp/HP
;;
esac
 $CMD -s $i "/usr/bin/ftp -v -n `@IP` << cmd
                 user `user` `passwd`
                 cd  $ref_ntp
                 lcd /tmp
                 get install.sh
                 quit
                 cmd "
 $CMD -s $i "/usr/bin/chmod +x /tmp/install.sh"
} >>  $NTP_DIR/resultats/deploi_ntp
sleep 1

done
Thanx
Jason

should work

Yes it should work with one caveat...

In your script, if the OS is not SunOS or HP-UX,
the $ref_ntp variable does not get set. You have no
default case to prevent further execution...

case $OS in
SunOS)
ref_ntp=/ref/ntp/SUN
;;
HP-UX)
ref_ntp=/ref/ntp/HP
;;
*)
echo "Unknown OS: $OS"
exit 2
;;
esac