作者knives ()
看板MAC
標題[求救] 怎麼預設啟用bash profile裡面的別名
時間Tue Jan 29 15:42:22 2013
我在家目錄下的 .bash_profile
下了一堆 alias
可是每次進命令列,都要手動下一次source ~/.bash_profile
裡面的別名才會有作用
要怎麼設定才能讓它自動啟用裡面的別名
謝謝回答
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.71.29.15
1F:→ uranusjr:Mac OS X 不讀 bash_profile (因為 OS X 的 Terminal 是 01/29 15:46
2F:→ uranusjr:login shell); 放 .profile 就會讀 01/29 15:47
3F:→ uranusjr:我記得是這樣啦, 你可能要去找一下資料看對不對 01/29 15:49
4F:→ alog:因為是 login shell 所以 bash 會讀取 .bash_profile 01/29 16:10
5F:→ alog:不知道樓主的 .bash_profile 到底有沒有問題 01/29 16:10
6F:→ alog:可以先將 .bash_profile 換名字,建立一個 .profile 01/29 16:12
7F:→ alog:把指令丟進去,如果指令運做起來有問題,則表示指令有問題 01/29 16:13
8F:→ dearlove:用.profile 01/29 16:16
9F:→ natoran:怎麼會,我的.bash_profile從10.6~現在都很正常啊! 01/29 20:33
10F:→ natoran:像是alias tar='tar --disable-copyfile'也有正常運作耶 01/29 20:34
11F:推 fischcheng:我的會讀啊 01/29 21:01
12F:→ tyf99:我都寫在 /etc/bashrc 01/29 21:34
13F:→ Vivirand:我的 ~/.bash_profile 也正常 01/29 22:13
14F:→ Mowd:寫在/etc/bashrc可以自動被載入沒問題 01/30 10:39
15F:→ knives:我寫在profile就可以了 01/30 19:43
16F:→ ryanlei:~/.profile 01/31 21:15