This shows you the differences between two versions of the page.
| |
| parsing_arguments_in_bash_script [06.12.2017 11:14] – created Pascal Suter | parsing_arguments_in_bash_script [20.01.2018 10:19] (current) – Pascal Suter |
|---|
| ====== Parsing arguments in bash script ====== | ====== Parsing arguments in bash script ====== |
| you can access positional arguments through the ''$1'' ''$2'' etc. varaibles and ''$#'' contains the number of positional arguments, but what if you want to parse more advanced, non positional arguments? this simple snippet that i stole from [[http://linuxcommand.org/lc3_wss0120.php|here]] provides an elegant and quick solution: | you can access positional arguments through the ''$1'' ''$2'' etc. varaibles and ''$#'' contains the number of positional arguments, but what if you want to parse more advanced, non positional arguments? this simple snippet that i stole from [[http://linuxcommand.org/lc3_wss0120.php|here]] provides an elegant and quick solution: |
| <code> | <code bash> |
| interactive= | interactive= |
| filename=~/sysinfo_page.html | filename=~/sysinfo_page.html |