Temat: uruchamianie skryptu przez www
witam uruchamiam sobie skrypty przez strone www
plik html
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
<title>Polecenie</title>
<form action="cgi-bin/ps.sh" method="get" enctype="text/plain"><div>
<p align="center">Polecenie</p>
<table align="center" bgcolor="silver">
<tr>
<td>
Podaj polecenie: <input type="text" name="polecenie">
</td>
</tr>
</table>
<table align="center" bgcolor="silver">
<tr>
<td>
Podaj has³o: <input type="password" name="pass">
<input type="submit" value="Wy¶lij" />
</td>
</tr>
</table>
</div></form>
</head>i plik ps.sh w cgi-bin
#!/bin/sh
polecenie=`echo "$QUERY_STRING" | sed -n 's/^.*polecenie=\([^&]*\).*$/\1/p' | sed "s/[%20+]/ /g"`
pass=`echo "$QUERY_STRING" | sed -n 's/^.*pass=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"`
echo "Content-type: text/plain"
echo ""
if [ "$pass" != "q" ]; then
echo 'B..dne has.o!'
exit 0
fi
echo " wynik $polecenie"
exit 0pytanie dlaczego jak podam 1 to potem wyświetla się jeden natomiast jak podam 123 to wysetla się 1 3 tj 2 zamienia się na spacje