shell文件

目录跳转

if [ ! -n "$1" ];then
echo ". g 0 [进入shell目录]"
echo ". g 1  [进入df‘s home]"
echo ". g shellName [运行shell]"
elif [ "$1" == 0 ];then
cd ~/shell/
elif [ "$1" == 1 ];then
cd ~/"df's home"/shell/
else
. ~/shell/$1 $2 $3
fi
if [ ! -n "$1" ];then
echo ". g [websiteName][0:查看目录]"
elif [ $1 == 0 ];then
ls  /www/wwwroot/
elif [ -d "/www/wwwroot/$1.dfer.top" ];then
cd /www/wwwroot/$1.dfer.top
elif [ -d "/www/wwwroot/$1.df315.top" ];then
cd /www/wwwroot/$1.df315.top
fi
if [ ! -n "$1" ];then
echo ". g websiteName"
else
cd /www/wwwroot/$1.df315.top
fi

根据参数进行判断跳转到特定目录

if [ ! -n "$1" ]; then
echo "1:nwq;0:web"
elif [ $1 == "1" ]; then
  cd /www/web/nwq_ycwjwl_com/public_html
elif [ $1 == "0" ] ; then
cd /www/web/
else
echo "1:nwq;0:web"
fi

save as “go”
run by “. ~/go”

阅读更多
版权声明:程序员是离地狱最近的职业 https://blog.csdn.net/dofun333/article/details/79959047
个人分类: Linux
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭