the end of file it receives when reading from a pipe after we force
interactive mode.
git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_3_0@16289
0c0555d6-39d7-0310-84fc-
f1cc0bd64818
test_interactive_prompt_stdout()
{
prompt="smb"
+ tmpfile=/tmp/smbclient.in.$$
- echo du | \
- CLI_FORCE_INTERACTIVE=yes \
- $SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp 2>/dev/null | \
+ cat > $tmpfile <<EOF
+du
+quit
+EOF
+
+ CLI_FORCE_INTERACTIVE=yes \
+ $SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp \
+ < $tmpfile 2>/dev/null | \
grep $prompt
if [ $? = 0 ] ; then
# got a prompt .. succeed
+ rm -f $tmpfile
true
else
echo failed to match interactive prompt on stdout
+ rm -f $tmpfile
false
fi
}