可有人請幫助我知道如何做到這一點:出口的bash變量
SCRIPT1:「xx.sh」低於
#!/bin/sh
echo "Content-type: text/html"
echo ""
tr=$(mktemp -d)
trr=$(echo $tr | awk '{split($0,array,"/")} END{print array[3]}')
pud=$(echo "$trr" | awk '{split($0,array,".")} END{print array[2]}')
mkdir $pud
echo -e "123" > file
mv file $pud/ #(briefly, I want to use this "file" in the script "yy.sh" for some other analysis. This is a webserver script snippet, based on my program, there could be many instances running at one time, hence "pud" has to be unique, and the "file" is unique for every instance too)
echo "<html>"
echo "<head>"
echo "</head>"
echo "<body>"
echo "<form action=\"yy.sh\" method=\"GET\">"
echo "<input type=\"submit\" value=\"Click me to get the results page.\">"
echo "</form>"
echo "</body>"
echo "</html>"
我想要做的就是這些行在第二個bash腳本「yy.sh」中獲取變量「pud」的值(「yy.sh」與「xx.sh」位於同一父目錄中)。有人可以幫助我知道如何做到這一點?
非常感謝!
什麼是你想要的輸出? – batMan
我已經編輯了腳本,請看一下,讓我知道如何做到這一點。謝謝!如果事情不清楚,請告訴我。 – Dipak