bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Determine if a file is a valid Bash script


From: Lane Schwartz
Subject: Determine if a file is a valid Bash script
Date: Mon, 19 Mar 2012 15:54:33 -0400

Hi,

If I have a file that contains a bash script, is there any
straightforward way of determining whether that script can be parsed
successfully as a Bash script, without actually running the file?

Here's the context. There is another tool (a workflow management
utility) which allows users to provide bash code to associate with
various elements of the workflow. When the user launches the workflow,
the various bash code they provided will all eventually be run. But
running the entire workflow potentially takes days or weeks.

It would be very desirable to be able to do a syntax sanity check on
the user-provided bash code prior to actually running it, in order to
let the user know if there are bash syntax errors in their code before
actually launching the workflow.

Thanks,
Lane Schwartz



reply via email to

[Prev in Thread] Current Thread [Next in Thread]