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

如何透過shell腳本永久設定環境變數?

tag-icon 2024-3-10 • tag-icon shell-script environment-variables
如何透過shell腳本永久設定環境變數?

假設我有一個腳本:

#!/bin/bash
echo "$1"
if [[ ! $1 ]]; then
    echo "True"
fi
export ABC="/home/aashish"

ABC執行此腳本後不可用。如何使該變數在執行後仍然存在?

答案1

source它進入目前的 shell 會話。

THE END
Ido 模式和最近開啟的文件 Ido 模式和最近開啟的文件
如何配置 VirtualBox 透過 tor 路由? 如何配置 VirtualBox 透過 tor 路由?

相關內容

熱門問答

熱門問答

  • shell-script
  • environment-variables
  • linux
  • networking
  • virtualbox
  • tor

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