Kann mir bitte jemand helfen zu wissen, wie dies zu tun:Export bash Variable durch HTML-Formular Methode
script1: „xx.sh“ hat diese Zeilen unter
#!/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>"
Was will ich tun Erhalte den Wert der Variablen "pud" im zweiten Bash-Skript "yy.sh" ("yy.sh" befindet sich im selben übergeordneten Verzeichnis wie "xx.sh"). Kann mir bitte jemand helfen, das zu tun?
Vielen Dank!
Was ist Ihre gewünschte Ausgabe? – batMan
Ich habe das Skript bearbeitet, bitte schauen Sie und lassen Sie mich wissen, wie das gemacht werden könnte. Vielen Dank! Wenn etwas nicht klar ist, lass es mich wissen. – Dipak