I've being playing around with `haredo` and being finding it awesome!
I'm trying to find out how to have the .do files share some variables,
e. g., PREFIX, PROGNAME, MANDIR, etc., since the `make` practices are
still ingrained in my head.
Since .do files are run with `sh -e`, one could simply create a, let's
say, `env.sh` file with something like this:
```bash
export PREFIX="${PREFIX:-"/usr/local"}"
export MANDIR="${MANDIR:-"${PREFIX}/share/man"}"
export PROGNAME="${PROGNAME:-"foo"}"
```
and source it in every .do file.
I was wondering the following:
1. Would there be any other way of achieving this variables sharing?
2. Should I be thinking differently on how to work with haredo? Perhaps
this sharing could be replaced with a more idiomatic construction?
> I've being playing around with `haredo` and being finding it awesome!
Nice, thanks for saying so :)
> I was wondering the following:
>
> 1. Would there be any other way of achieving this variables sharing?
The way you've listed is the best way I know of. Since the environment
variables carry down to child processes, you can get away with just
sourcing env.sh in the .do files that you intend to call as top-level
targets, but that's the only improvement.
> 2. Should I be thinking differently on how to work with haredo? Perhaps
> this sharing could be replaced with a more idiomatic construction?
>
I think you're thinking just fine, I'd say this method is idiomatic,
although if you find a better way feel free to share it!
~Autumn