首页 > 系统服务 > 详细

linux sheel script demo

时间:2017-04-10 16:32:32      阅读:255      评论:0      收藏:0      [点我收藏+]

1. target :

    输入姓、名, 输出姓名

2. create directory

     mkdir ~/bin

3. create & edit sheel script

    vim fullname.sh

    note:  more comment is useful

#!/bin/bash
#Program
#       User inputs his first name and last name . Program shows his full name.
#History :
#2017/04/10     logan   First lease
PATH=/bin:$PATH #将当前目录加入系统环境
export PATH
read -p "Please input your firstname:" firstname
read -p "Please input your lastname:"   lastname 
echo -e "\nYour full name is :" ${firstname} ${lastname}

 4. run

   [rocky@localhost bin]$ sh fullname.sh

linux sheel script demo

原文:http://www.cnblogs.com/rocky-fang/p/6689592.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!