Haskell library for parsing Bash scripts?

Does anyone know a Haskell library that can parse arbitrary Bash scripts?

A quick Hackage search indicates that there is a package called bash for writing scripts, but I donโ€™t see anything to parse it.

Basically, I just had a large collection of Bash scripts that were thrown to me, and I would like to do code analysis on it. But at the first stage, obviously, there will be an opportunity to analyze this material.

I don't know Bash very well personally. I suppose I could sit down and go through a voluminous man page to get her full BNF grammar. (I imagine this is a very complex issue, given the story with a long and backward compatible shell). I'm just wondering if anyone else has done this job for me ...

+7
source share
1 answer

The language-sh extension is possible.

Language.Sh is a collection of modules for parsing and manipulating expressions in shell grammar. This is part of a larger project, shsh. Please note that the API is somewhat unstable until we reach version 1.0.

+4
source

All Articles