Skriptausführung Status Erwartet Skript erwarten, wie im Skript if [$? -eq 0]
wirft alsIm Folgenden
invalid command name "$?"
while executing
"$? -eq 0 "
invoked from within
"if [ $? -eq 0 ]"
(file "./tmp544.sh" line 7)
#!/usr/bin/expect -f
eval spawn ssh -l root 174.54.87.12 rsync /root/project /usr/project
expect "[email protected]'s password: $"
send "\xxxxxxx\n"
expect "\\$ $"
if [ $? -eq 0 ]
then
echo "11"
else
echo "22"
fi
erwarten {\ $ $} ist eine wohl eher idiomatische Alternative zu erwarten "\\ $ $" –