0

example code:

function purge() {
delete_dir;

case $purge_arg in --static) delete_static_dir; ;; esac

}

while getopts ":nrp:h" opt; do case ${opt} in h ) guide; ;; n ) new_address; ;; r ) tor_server; ;; p ) purge_arg=${OPTARG} purge ;; esac done

problem:

./script.sh -p --static #it's work
deleting dir;
deleting static dir.

./script.sh -p #It should run the delete dir command but it doesn't work

what should i do to make it run?

rojen
  • 184

0 Answers0