Re: [問題] 請問shell script中export環境變數的問題
think about
#1) 'export' to next script
#script2--------
export PORT=Linux
./script1
#===============
#script1--------
echo $PORT
#===============
#2) 'source' from provious script
#script2-------
PORT=Linux
#==============
#script1-------
. ./script1
#source ./script1
echo $PORT
#=============
I think you are ask about #2
※ 引述《wahoho (..)》之銘言:
: 如果現在有兩個script
: script1和script2
: 內容分別是
: #script2
: export PORT=Linux
: #end of file
: =============
: #script1
: ./script2
: echo $PORT
: #end of file
: 請問有辦法讓script2中export的變數繼續存在script1裡面嗎?
--
Sincerely Yours,
I_Love_Linux
如有離題,請略過;如有錯誤,請回報;如有不懂,請再問;如有幫助,請享用;如有感謝,請告知
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 221.169.88.17
推
09/16 04:58, , 1F
09/16 04:58, 1F
討論串 (同標題文章)