#! /usr/bin/ksh
# author shenlu
#pwd=`pwd|perl -ne ‘print if s#((/[^/]*){3}).*#\1#‘`
#shenlu="s#([a-z])([^=]{1,})=.*$pwd.*#type=\1;env=\2#"
#evalstr=`alias | perl -ne ‘print if s#([a-z])([^=]{1,})=.*$pwd.*#type=\1;env=\2#‘`
#eval $evalstr
#echo $evalstr
print "*******weclcome to use shenlu‘s shell at `date`"
if [ $# -eq 0 ] ; then
echo ‘########error input parameter eg b12 x86 b16######‘
echo ‘####googbye next time!!!‘
exit 1
else
target=$1
envstr="s#(.)(.*)#type=\1;env=\2#"
pwd=`echo $target | perl -ne "print if $envstr"`
eval $pwd
echo $eval
fi
if [ x$target == xx86 ] ; then
ftp -i 10.33.254.22
exit 0
elif [ x$env == x12 ] ; then
if [ x$type == xb ] ; then
url=10.33.255.13
elif [ x$type == xf ] ; then
url=10.33.255.12
fi
else
url=10.33.254.16
fi
if [ x$target != x ] ; then
if [ x$type = x‘f‘ ] ; then
shenstr=‘前台‘
elif [ x$type = x‘b‘ ] ; then
shenstr=‘后台‘
fi
fi
echo "==============telnet to $shenstr;$env ================\n"
ftp -i $url
echo ‘ftp to successful!‘
信息中心cmo shenzhixin
2015-10-12