help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] Show dependencies of bash script


From: Eduardo A . Bustamante López
Subject: Re: [Help-bash] Show dependencies of bash script
Date: Mon, 22 Jun 2015 18:34:14 -0500
User-agent: Mutt/1.5.23 (2014-03-12)

On Mon, Jun 22, 2015 at 10:56:42AM -0500, Peng Yu wrote:
> Hi, I am wondering if there is a way to print all the external
> commands that a bash script depend on (including the dependencies that
> can not be resolved before running time) without actually running the
> script. Does anybody know a solution to this?

This is a bit pointless:

1. You can only find out the name of the command, it doesn't tell you what the
actual command does, or if it behaves the way you expect (for example, the
script could be picking up a custom grep that doesn't support the options you
need). Or it could be a function in a sourced file.

2. In some cases, you can only find the command to execute *after* running the
script.

So, no, there's no solution. The most you can do is some static analysis to
find the command names that are not dynamic and to source the files that are
available at this step.

-- 
Eduardo Bustamante
https://dualbus.me/



reply via email to

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