I want to set .bashrc to check a specified command and ask for confirmation before execution.
For example, I want to set command 'rm' in .bashrc to receive a question before execution started otherwise being terminated.
read -p "Type password? " pass
if [ "$pass" = "1234" ]; then
// do the execution
else
// Termination and echo a message wrong pass.
fi
Example:
> rm MyFile.txt
Type password? ****
You have successfully removed MyFile.txt
>