Skip to content

options

useful options
-v  # print shell input lines while executed  
-x  # print commands/arguments as executed  
-e  # exit on first error  
-o  # option-name` set bash options by name
enable options in scripts
bash -x /path/to/script
#!/bin/bash -e
#!/usr/bin/env -S bash -e
enable options
set -x
set -o xtrace
shopt -s -o xtrace
disable option
set +x
set +o xtrace
shopt -u -o xtrace
show bash options
shopt [option-name]
shopt -o [option-name]

https://tldp.org/LDP/abs/html/options.html#OPTIONSTABLE


last updated: Sat Aug 12 14:29:24 2023

Back to top