可有人请帮助我知道如何做到这一点:出口的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