請問shell script中export環境變數的問題 - Linux

By Frederica
at 2008-09-15T22:54
at 2008-09-15T22:54
Table of Contents
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
如有離題,請略過;如有錯誤,請回報;如有不懂,請再問;如有幫助,請享用;如有感謝,請告知
--
#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
如有離題,請略過;如有錯誤,請回報;如有不懂,請再問;如有幫助,請享用;如有感謝,請告知
--
Tags:
Linux
All Comments

By Harry
at 2008-09-20T10:05
at 2008-09-20T10:05
Related Posts
mysql資料庫匯出

By Mary
at 2008-09-15T22:31
at 2008-09-15T22:31
mysql資料庫匯出

By Brianna
at 2008-09-15T20:06
at 2008-09-15T20:06
請問shell script中export環境變數的問題

By Cara
at 2008-09-15T20:04
at 2008-09-15T20:04
急問 關於架站在linux上

By Victoria
at 2008-09-15T17:45
at 2008-09-15T17:45
急問 關於架站在linux上

By Jake
at 2008-09-15T17:39
at 2008-09-15T17:39