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

[ale] How to pass vars to lots of shell scripts?



On 10/18/2013 01:03 PM, leam hall wrote:
> So far, that's what I'm thinking. The process would be:
> 
> master script zeros out the param file
> master script takes options given to it and writes to a param file
> For example:
> 
> params.sh
>   TEST=0  # Test for condition, default true
>   FAIL=1   #  Has not failed yet
>   FIX=1     #  Default  to do not fix
> 
> Called script looks something like:
> 
> . params.sh

There be dragons.

What happens if the master script crashes/fails to clean up and you run
one of the subordinate scripts?

What happens if you run multiple instances of the master script
simultaneously (unintentionally, perhaps)?

Environment variables and/or command line arguments are the safe ways to
do this.  Files are not.  (Pipes are ok too, but can be hard to use for
this case.)

Phil