今天這個腳本其實很簡單,但很實用,講的是shell中函數的應用
To turn the functions in this chapter into a library for use in other scripts, extract all the functions and concatenate them into one big file. If we call this file library.sh, a test script that accesses all of the functions might look like this:
應用函數,我們就可以複用我們的腳本。
值得注意的是 $ . <b>tinyscript.sh ,就是在目前shell下執行腳本,不加"."或source</b>
<b>則會在子shell下執行腳本,可能會有不同的情況發生,值得注意。</b>
<b></b>
<b>本文轉自 hb_fukua 51CTO部落格,原文連結:http://blog.51cto.com/2804976/597476</b>