码迷,mamicode.com
首页 > 系统相关 > 详细

shell脚本带参数实例

时间:2016-04-09 17:09:22      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:shell 参数

#!/bin/bash
name=$1
old=$2
if [[ $# -ne 2 ]];then
echo "the test must input 2 nu!!"
echo $#
exit 0
fi
echo "my name is ${name}!"
echo "i‘m ${old} yeas old!"
if [[ ${old} <30 ]];then
echo "you are so yunng!"
else
echo "so old!"
fi

shell脚本带参数实例

标签:shell 参数

原文地址:http://chicozy.blog.51cto.com/8521389/1762053

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!