Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

zpty woes



In the script attached, when trying to follwing line always fails.

    zpty -r scppty line "*:" || echo "no password asked" && exit

It appears that the "password" string from the ssh session is discarded
by the psuedo terminal.

Is there a way to fix this? or Am I missing something?

Thanks,

Jaime

#SCRIPT FOLLOWS

#!/bin/zsh -x

zmodload zsh/zpty

zpty scppty scp hello.world luser@host:~/
zpty -t scppty || echo "something went wrong" && exit
zpty -r scppty line "*:" || echo "no password asked" && exit
zpty -w scppty "TopSecret"
while zpty -r scppty line;
    do
        result+="$line"$'\n'
    done
zpty -d scppty
print $result



Messages sorted by: Reverse Date, Date, Thread, Author