I have a couple of arguments inside a list (array, e.g. $@) and I'd like to know if the option -v is in the list.  In Python I would simply do:verbose = -v in sys.argvHow do I achieve that in shell without much code?
Shell is option given
shell;options
In a shell script, you call the getopts function in a loop. There is a code example in the dash manual.Note that your Python code is not correct except in extremely simple cases. It detects an argument -v anywhere on the line, even if it's the argument of another option or after non-option arguments. The correct way to parse options in Python is with argparse or optparse.