1、子程式僅會繼承父程式的環境變數,子程式不會繼承父程式的自訂變數。
自訂變數:通過export申明成環境變數
將環境變數轉成自訂變數:declare
環境變數=全域變數
自訂變數=地區變數
2、read [-pt] variable
選項與參數:
-p:後面可以接提示字元!
-t:後面可以接等待的『秒數!』這個比較有趣~不會一直等待使用者啦!
read -p "input name :" -t 30 name
3、ulimit【2】
ulimit - get and set user limits
4、~/.bash_history記錄了曆史的命令
[root@www ~]# !number
[root@www ~]# !command
[root@www ~]# !!
選項與參數:
number :執行第幾筆指令的意思;
command :由最近的指令向前搜尋『指令串開頭為 command』的那個指令,並執行;
!! :就是執行上一個指令(相當於按↑按鍵後,按 Enter)
5、profile
① /etc/profile:這是系統整體的設定,你最好不要修改這個檔案;
② ~/.bash_profile 或 ~/.bash_login 或 ~/.profile:屬於使用者個人設定,你要改自己的資料,就寫入這裡!
參考
【1】 http://blog.163.com/zhoumhan_0351/blog/static/39954227201061411191729/
http://blog.163.com/zhoumhan_0351/blog/static/399542272010533254171/
http://blog.163.com/zhoumhan_0351/blog/static/39954227201061045630711/
【2】 http://linux.vbird.org/linux_basic/0320bash.php#bash_bash