I have wrote a script to do some backup. There is a if block to ask confirmation:
read -p "Do you want to continue? [y/n]" confirm
if [[ ${confirm} == "n" ]]; then
# do something like CTRL+Z, and halt until I run fg <job number> to activate this script
else
# do some stuff
fi
can anyone help?
You could use
kill -STOP $$, or inbashyou can use thesuspendcommand.