Have you run into this problem before? I have one script calling a second
script. The second script contains this code:
if [ -e index.html ]; then
echo -e "\nCtrl-c to preserve old index.html and terminate processing\n"
echo "enter 'y' to delete index.html, or 'n' to retain the current index.html"
rm -i index.html
fi
When we get to that section, if index.html exists, this is what we see on
the screen (I entered the 'y' that's on a line by itself):
Ctrl-c to preserve old index.html and terminate processing
enter 'y' to delete index.html, or 'n' to retain the current index.html
y
rm: remove regular empty file `index.html'?
In other words, it does not show the prompt from "rm -i" until after the
response has been entered. Any ideas? I think it has something to do
with the fact that the script is called by another script. If I call the
script directly from the command line, it behaves just fine. It would
make more sense to me if I never saw the prompt, but it does appear, just
a little too late.
Mike