Also, bei mir geht das:
curl -s http://10.10.10.105:9981/status.xml
gibt in der ZSH
chepaz@xmgbook
~ .:] curl -s http://10.10.10.105:9981/status.xml
<?xml version="1.0"?>
<currentload>
<systemload>1.020000,0.880000,0.910000</systemload>
<recordings>
<recording>
<next>362</next>
</recording>
</recordings>
<subscriptions>1</subscriptions>
</currentload>%
bzw.:
chepaz@xmgbook
~ .:] curl -s http://10.10.10.105:9981/status.xml | grep "subscriptions" | awk -F '>' '{print $2}' | awk -F '<' '{print $1}'
1
und auch in der Bash:
[chepaz@xmgbook ~]$ curl -s http://10.10.10.105:9981/status.xml
<?xml version="1.0"?>
<currentload>
<systemload>0.980000,0.930000,0.920000</systemload>
<recordings>
<recording>
<next>360</next>
</recording>
</recordings>
<subscriptions>1</subscriptions>
</currentload>
[chepaz@xmgbook ~]$ curl -s http://10.10.10.105:9981/status.xml | grep "subscriptions" | awk -F '>' '{print $2}' | awk -F '<' '{print $1}'
1
Irgendwelche komischen Dinge in der .bashrc stehen?
Edit:
Hast du das Script Copy&Paste übernommen? Irgendwelche wilden, unsichtbare, dubiosen, Codierungen aus dem Browser mitgenommen?
Edit#2:
Was ist in Shellscript ein "if -a"]. Was macht das? Ich finde auch spontan nichts drüber. Es ist ein UND.
Edit#3:
"Unsere" Bash verhält sich da anders als die von Debian. Das "-a" ist wohl ein Problem. So müsste es gehen wenn man das Script umschreibt:
[chepaz@xmgbook ~]$ shutdown_timer=1
[chepaz@xmgbook ~]$ echo $shutdown_timer
1
[chepaz@xmgbook ~]$ curl -s http://10.10.10.105:9981/status.xml | grep "subscriptions" | awk -F '>' '{print $2}' | awk -F '<' '{print $1}'
1
[chepaz@xmgbook ~]$ if [ $(curl -s http://10.10.10.105:9981/status.xml | grep "subscriptions" | awk -F '>' '{print $2}' | awk -F '<' '{print $1}') -eq 0 ] && [ $shutdown_timer -eq 0 ]; then echo "fooooo"; else echo "baaaaaar"; fi
baaaaaar
[chepaz@xmgbook ~]$ shutdown_timer=0
[chepaz@xmgbook ~]$ echo $shutdown_timer
0
[chepaz@xmgbook ~]$ if [ $(curl -s http://10.10.10.105:9981/status.xml | grep "subscriptions" | awk -F '>' '{print $2}' | awk -F '<' '{print $1}') -eq 1 ] && [ $shutdown_timer -eq 0 ]; then echo "fooooo"; else echo "baaaaaar"; fi
fooooo