Hallo,
ich möchte per php mit dem system() befehl ein shellscript ausführen.
system ("$pathserv/settings.sh ".$var1." ".$wert[$i]."", $rueckwert[$i]);
das funktioniert so nun wunderbar, allerdings bekomme ich als Rückgabewert immer nur eine 0. Was denk ich normal ist, und bedeutet das alles geklappt hat. Jetzt will ich aber nicht diese 0 sondern die Ausgabe in der Variable $rueckwert gespeichert bekommen. Gibt es da eine Möglichkeit ? Hier nochmal die Zeile aus dem shellscript:
sed -n '/^'${2}'/p' ${pathconf}/serv${1}.conf | cut -d "=" -f2
Beste Grüße
Alex
sh Variable an php script zurück geben
Re: sh Variable an php script zurück geben
Schreibe die Ausgabe in eine Datei und verarbeite diese...
PayPal.Me/JoeUser ● FreeBSD Remote Installation
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Re: sh Variable an php script zurück geben
ich habs schon gefunden. Man muss das ganze nicht erst in einer Datei speicher, wenn man statt system() exec() benutzt.
