**(#zzyjqvq) So I re-write this shell alias that I used all the time alias dkv="docker rm" to be a much safer shell function:

dkv() {
  if  ...**
So I re-write this shell alias that I used all the time `alias dkv="docker rm"` to be a much safer shell function:

dkv() {
if [[ โ€œ$1โ€ == โ€œrmโ€ && -n โ€œ$2โ€ ]]; then

read -r -p "Are you sure you want to delete volume '$2'? [Y/n] " confirm
confirm=${confirm:-Y}
if [[ "$confirm" =~ ^[Yy]$ ]]; then
  # Disable history
  set +o history

  # Delete the volume
  dock ... โŒ˜ [Read more](https://twtxt.net/twt/ml3toqq)

โค‹ Read More

Participate

Login or Register to join in on this yarn.