💻
💻
💻
💻
Today I Learned
Search…
⌃K
💻
💻
💻
💻
Today I Learned
Search…
⌃K
README
analytics
bash
bash forloop
parameter expansion
prompt confirmation in bash
db
dgraph
docker
fish
git
go
k8s
linux
net
osx
python
react
unix
vim
web
Powered By GitBook

prompt confirmation in bash

From http://stackoverflow.com/questions/1885525/how-do-i-prompt-a-user-for-confirmation-in-bash-script​
read -p "Are you sure? " -n 1 -r
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
Previous
parameter expansion
Next
db
Last modified 1yr ago
Copy link