샘플 코드:
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
질문:
./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
실행되게 하려면 어떻게 해야 합니까?