Linux
  • Linux
  • Bash
  • Debian
  • Ubuntu
  • Shell
  • CentOS
  • SSH
☰

從 bash 腳本填入別名資料庫

tag-icon 2024-6-10 • tag-icon linux shell-script
從 bash 腳本填入別名資料庫

我的腳本startalias.sh:

#!/bin/sh
alias ls='ls -al --color=auto'

當我運行此腳本時,我的別名資料庫不會拾取它。但如果我直接在 shell 中寫它就可以了。為什麼?

答案1

alias是一個 shell 內建的。在子 shell 中執行(如在腳本中)不會影響主 shell。

THE END
在 Debian 9 上安裝 Viber 在 Debian 9 上安裝 Viber
為什麼 xenodm 在 OpenBSD 中預設不啟動 X Window 系統? 為什麼 xenodm 在 OpenBSD 中預設不啟動 X Window 系統?

相關內容

熱門問答

熱門問答

  • linux
  • shell-script
  • debian
  • apt
  • x11
  • openbsd

© 2024 rvso.com 版權所有. 網站地圖