Do You even get a prompt for answer to Your read statement? I think that since ssh is non-interactive (not a controlling terminal) You can't have a terminal like session, either You must work with something like expect or keep the script locally and just "collect" whatever info You need from the remote host and process it locally.
Make a local script and run it locally:
Quote:
#!/bin/bash
ssh user@ubuntu ls -l \~/test
echo "Continue counting files starting with a ?"
read answer
if [ "$answer" = y ]
then
ssh user@ubuntu ls -l 'a*'
else
exit
fi
|
You must protect any arguments from being interpreted by Your local shell wich backslash or single quotes.
/Lakris