Here is my Bash script.
Assuming that : 1) go.sh is the script to execute 2) the user will launch the script this way
# ./go.sh -v file1.txt file2.txt
or
# ./go.sh --verbose file1.txt file2.txt
3) I would like to have a more elegant way to write this :
#!/bin/bash
Verbose_Mode=0
until [ "$#" == "0" ]; do
case $1 in
"-v" or "--verbose")
Verbose_Mode=1
;;
This will result in a syntax error because of :"-v" or "--verbose".
My question : How can I properly write (if possible) the code :
#!/bin/bash
Verbose_Mode=0
until [ "$#" == "0" ]; do
case $1 in
"-v")
Verbose_Mode=1
;;
--verbose")
Verbose_Mode=1
;;
esac
Thanks in advance for answers.