Wir haben in einem Perlscript folgenden Befehl zum ausführen gebracht:
[codebox=perl file=Unbenannt.pl]
my $nonce_string = 'curl -k -u user:password -s http://localhost/balancer-manager | sed -n "/href=/s/.*href=\([^>]*\).*/\1/p" | tail -1 | sed -n "s/.*nonce=\(.*\)\"/\1/p"';
system($nonce_string)
[/code]
Da wir nun die Scripte auf pyton umstellen wollen, wollten wir das auch adaptieren. Nunkommt es jedoch zu folgendem Problem in dem testscript
Code: Alles auswählen
import os
nonce_string = 'curl -k -u user:password -s http://localhost/balancer-manager | sed -n "/href=/s/.*href=\([^>]*\).*/\1/p" | tail -1 | sed -n "s/.*nonce=\(.*\)\"/\1/p"'
os.system(nonce_string)
sh: -c: line 0: unexpected EOF while looking for matching `"'
sh: -c: line 1: syntax error: unexpected end of file
VG niesel
