shell学习笔记(十三)

 function可以将一大段的shell语句做一个省略,并可作为一个“命令”执行。

e.g

[root@test shell]# cat test 

#!/bin/bash

function_date1()

{

date +%Y.%m.%d

}


function_date2()

{

date +%Y-%m-%d

}

function_date1

function_date2

[root@test shell]# ./test 

2011.10.13

2011-10-13

你可能感兴趣的:(function,shell,职场,休闲)