getopts: как писать CLI-утилиты с флагами без внешних библиотек

Привет, Хабр! getopts — это встроенный в любой POSIX-совместимый Linux/Unix-shell мини-парсер аргументов. Один shebang — и у вас CLI-утилита без единой внешней зависимости. В статье рассмотрим, как выжать из getopts максимум, где он спотыкается и когда пора переехать на getopt или Argbash.

https://habr.com/ru/companies/otus/articles/911338/

#linux #shell #bash #getopts #clitools

getopts: как писать CLI-утилиты с флагами без внешних библиотек

Привет, Хабр! getopts — это встроенный в любой POSIX-совместимый Linux/Unix-shell мини-парсер аргументов. Один shebang — и у вас CLI-утилита без единой внешней зависимости. В статье рассмотрим, как...

Хабр

New Episode: hpr4088 :: Today I Learnt more Bash tips

Hosted by Some Guy On The Internet on 2024-04-03 is flagged as Clean and is released under a CC-BY-SA license.

Tags: #BashTips, TTIL, #getopts.

https://hackerpublicradio.org/eps/hpr4088/index.html

Hacker Public Radio ~ The Technology Community Podcast

Hacker Public Radio is a podcast that releases shows every weekday Monday through Friday. Our shows are produced by the community (you) and can be on any topic that is of interest to hackers and hobbyists.

Show Bash script usage

@podfeet @bbusschots wow! It just blew up when I did an integration test.
But I wrote solid unit test. There must be something that has to do with loading a file using the source command and maybe at overwrites some variables. Still researching it. #bash #ProgrammingByStealth #getopts #unittest #integrationtest #PBS149
Parse Arguments in Bash Scripts With getopts - OSTechNix

In this article, we are going to see how to parse arguments in bash scripts using bash builtin getopts function with examples.

OSTechNix