关闭

两个最基础的Shell Script代码

367人阅读 评论(0) 收藏 举报
分类:
#!/bin/bash
#Program:
#   This program shows "hello world" in your screen.
#History:
#    2013/083/36   ydonghao
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
echo "hello world! \a \n" 
exit 0


2、

#/bin/bash
#Program:
#     User inputs his first name and last name. Program shows his full name.
#History:
#    2013/08/26  ydonghao
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH

read -p "Please input your first name:" firstname
read -p "Please input your last name:" lastname
echo "\nYour full name is : $firstname  $lastname"


0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:65277次
    • 积分:1621
    • 等级:
    • 排名:千里之外
    • 原创:93篇
    • 转载:54篇
    • 译文:1篇
    • 评论:3条
    最新评论