Welcome 微信登录
编程资源 图片资源库 蚂蚁家优选 PDF转换器

首页 / 操作系统 / Linux / 第一个Unix Shell函数

凡事都有个开头;有句话说,万事开头难;不管以后的路怎么样,走好脚下的每一步。今天接触到了Unix shell中的函数,记录下,写了个hello函数,如下:pg fun_hello.sh
#!/bin/kshhello () {
  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 FridayUnix Date命令 http://www.linuxidc.com/Linux/2013-02/78923.htm--the end--