MORBIG(1)
π MORBIG(1) π
okay so bestie, welcome to morbig β it's a POSIX shell script parser, and it lives in the General Commands Manual section, iykyk. this is the whole vibe, let's get into it π«Ά
β¨ NAME β¨
morbig β POSIX shell script parser ππ
πΈ SYNOPSIS πΈ
morbig [ option ]... [ script-file ]...
π¦ DESCRIPTION π¦
so morbig(1) is literally a parser for shell scripts written in the POSIX shell script language. the way it works? it parses your scripts statically, meaning it does NOT execute them, and it constructs a concrete syntax tree for each one. those trees get built using constructors according to the shell grammar of the POSIX standard. no cap. π
and because the POSIX standard said so, morbig does alias expansion before it does syntactic analysis. so the alias and unalias commands get executed by morbig β and yeah, it allows for multiple arguments β but ONLY when these commands occur at toplevel, like, not inside a compound control structure (think a conditional construct or a loop construct, bestie). π«
β οΈ and if analiasorunaliascommand shows up inside a compound construct? morbig raises an error, because those literally cannot be handled statically. periodt.
the parser processes input files in order, and it stops at the first error it encounters. but don't worry β you can change that whole behaviour with the --continue-after-error option. β¨
π OPTIONS π
the following command-line options are recognized, bestie, listen up:
--skip-noshβ skips input files that either are ELF executables, or that start with a magic string indicating a bash or perl script. not today, binary! π--asformat β for every input file that got successfully parsed, write a file containing the concrete syntax tree of the script. the format can be one of these cuties:binβ binary format. this one can be read by applications using the morbig OCaml library. and btw, this is the default. πdotβ graphic representation in the dot format.jsonβ complete JSON output, including position information.simpleβ simplified JSON output. use this one for human-readable output, fr fr. πnoneβ do not serialise the concrete syntax tree.
--from-stdinβ read the names of input files from standard input. π«Ά--continue-after-errorβ if parsing of an input file fails, then write the error message in the filefile.morbigerrorinstead of stderr, and continue on with the next input file. this is iconic for parsing a large number of scripts without creating a new UNIX process for each of them, like this:
find . -name "*.sh" | morbig --continue-after-error --from-stdin
π₯
--display-statsβ at the end, print the total number of treated input files, the number of skipped input files, and the number of rejected input files. numbers girlies rise π--debugβ activate debugging information. πβ¨--versionβ show the version number and exit. bye bestie π--helpβ display usage information. the classic. π
π§ AUTHORS π§
morbig has been written for the project CoLiS by Yann RΓ©gis-Gianas, Nicolas Jeannerod and Ralf Treinen. absolute icons, we stan. π
and that's a wrap on the morbig(1) page bestie β MORBIG(1), out. slay, go parse something ππ
β¨
π¦ where this page comes from
- debian bookworm: morbig 0.10.4-6+b1 Β· GPL-3-opengroup
- debian trixie: morbig 0.11.0-3+b9 Β· GPL-3-opengroup
- ubuntu jammy: morbig 0.10.4-5build3 Β· GPL-3-opengroup
- ubuntu noble: morbig 0.11.0-1build1 Β· GPL-3-opengroup
- ubuntu questing: morbig 0.11.0-3build8
- ubuntu resolute: morbig 0.11.0-4build2 Β· GPL-3-opengroup
- ubuntu stonking: morbig 0.11.0-7build1 Β· GPL-3-opengroup
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms