I wrote a post-install script, which is executed after the package installation by command like " pkgadd -d /mypackage.pkg".
I also want to read user input in post-install script as follows:
while [ "$ANSWER" != "y" -a "$ANSWER" != "n" ] ;
do
echo "Apply changes to database? [y/n]:"
read ANSWER
done
However, it does NOT pause and wait for user input at all! Instead, it goes into an infinite loop:
Apply changes to database? [y/n]:
Apply changes to database? [y/n]:
Apply changes to database? [y/n]:
Apply changes to database? [y/n]:
Apply changes to database? [y/n]:
Any advice will be appreciated!
(By the way, if I run the script separately, everything is fine!)