日期:2014-05-16 浏览次数:20685 次
HOSTNAME=$1
USER="hadoop1"
PWD="hadoop1"
FILEPATH=$2
FILENAME=$3
SLEEPCNT="5"
LOGFILE="`pwd`/logs/startHadoop.log`date +%m%d%y`"
i=1
while [ `expr $i` -lt 2 ]
do
i=`expr $i + 1`
(
sleep $SLEEPCNT;
echo $USER;
sleep $SLEEPCNT;
echo $PWD;
sleep $SLEEPCNT;
echo "cd "$FILEPATH;
sleep $SLEEPCNT;
echo "nohup ./"$FILENAME" &";
sleep $SLEEPCNT
exit
) | telnet $1
done
if [ $? -eq 0 ];
then
echo "success"
echo $?
exit 0
else
echo "success"
exit 0
fi
i=1i=1 然后
while [ `expr $i` -lt 2 ]
do
i=`expr $i + 1`
`expr $i` -lt 2执行while循环体,接着
i=`expr $i + 1`那while在此就失去了循环的意义,请问,大家是否同意此看法?
) | telnet $1此处的 | 在此是什么作用呢?