welcome to the community @priya_joshi.
As always at this forum, provide the small representative sample of the input data - the one that would allow the YOU (and us) to thoroughly test any potential solution.
No .... for "missing data", small, but set of data covering any edge cases, e.g. in you case does input contain multiple "module" blocks, etc...
Also, as always post your sample input/output data and any personal attempts at solving your issue using markdown code tags. The description of these "markdown code tag" are linked in the welcome page of the forum portal.
And more importantly, please share any of your own attempts at solving the issue - this will "guide us" at helping you.
You should show (as previously requested) an example of the input containing at least two different examples of a module block.
You should show the results of your attempted commands, and attempt to repair any syntax errors.
If the code appears to hang, it is probably waiting tor data on stdin, instead of reading the file as you expect. Type a couple of random lines (hello and goodbye for example), then Ctrl-D to end the input. Observe and understand the response.
You probably need to investigate what the FS variable actually does.