getopts

how to exit immediately with getopts option in bash script

In a Bash script that uses `getopts` for option parsing, you can exit immediately by using the `exit` command when an option is encountered that should trigger an immediate exit. Here's an example: ```bash while getopts "abc:" opt; do  …

Load More
That is All