Ben Chuanlong Du's Blog

It is never too late to learn.

Shell Command Parser

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Golang Package - sh

sh is a shell parser, formatter, and interpreter. Supports POSIX Shell, Bash, and mksh. Requires Go 1.17 or later.

Python Package - shlex

shlex makes it easy to write lexical analyzers for simple syntaxes resembling that of the Unix shell.

Python Package - bashlex

bashlex is a Python port of the parser used internally by GNU bash.

Comments