My goal is to add a path to user PATH environment variable during installation process but I want to request his permission first.
A workaround would be to set an option for cmake command line but it’s not user friendly as he must allow (or disallow) at configuration step for the manipulation, which is disconnect from installation time.
#/usr/bin/env bash
while true; do
read -p "Do you want to go on? (yn) " yn
case $yn in
[yY] ) echo "go on";
exit 0;;
[nN] ) echo "stop";
exit 1;;
* ) echo "invalid response";;
esac
done
read prompt is not displayed and echo command are buffered into FOO but not displayed.
besides in this case all echo are buffered, whereas I would be interested only in the last echo (for instance: “stop” instead of “invalid response invalid response invalid response invalid response stop”)
I don’t know that stdin is forwarded properly for this kind of stuff. I have no idea what this means for cmake-gui or ccmake (in a full CMake run). Script mode might be able to support it, but it sounds new to me.