设为首页 加入收藏

TOP

第一个Unix Shell函数
2014-11-24 08:27:22 来源: 作者: 【 】 浏览:1
Tags:一个 Unix Shell 函数

凡事都有个开头;有句话说,万事开头难;不管以后的路怎么样,走好脚下的每一步。


今天接触到了Unix shell中的函数,记录下,写了个hello函数,如下:


pg fun_hello.sh
#!/bin/ksh


hello () {
echo "Hello ,this is my first Shell function!"
echo "Today is `date +%Y-%m-%d\ %H:%S:%M\ %A`"
}
#Call hello function
hello
#EOF


执行脚本:


sh fun_hello.sh
Hello ,this is my first Shell function!
Today is 2013-02-01 15:48:25 Friday


--the end--


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇shell脚本删除目录下的指定文件 下一篇UNIX Shell循环控制—while

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·如何理解c语言指针和 (2025-12-27 01:19:11)
·为什么C标准库没有链 (2025-12-27 01:19:08)
·玩转C语言和数据结构 (2025-12-27 01:19:05)
·MySQL 基础入门视频 (2025-12-26 23:20:22)
·小白入门:MySQL超详 (2025-12-26 23:20:19)