4 ms·
better management of your dependencies, also bundling to single file for easier distribution. In future transforming scripts with plugins means reusing fish sh
by drkraken 10y ago
better management of your dependencies, also bundling to single file for easier distribution.
In future transforming scripts with plugins means reusing fish shell functions in bash scripts .etc
Also each shell has different syntax for sourcing files.
- mbreese 10y agoIf you're needing to manage dependencies for a bash script, are you sure you're using the right language for the job? I'm not convinced that mixing and matching functions from different shells is a good thing.
- techdragon 10y agoI like to modularise my shell scripts for maintainability reasons. It would be nice to be able to just "pull in the pieces" as needed from my collection of components instead of, as I currently tend to do, re-including them wherever I'm using them.
- matt_wulfeck 10y agoAt that point why not just use a battle-tested config management tool? Ansible, salt, chef, puppet...
- mbreese 10y agoI guess I'm having trouble seeing the use-case for having large enough shell scripts to require splitting them up into modules. What types of functions do you write in shell that you need to re-import?
- daenney 10y agoHow is this not achievable by the source builtin? It's perfectly feasible to have small bash scripts, library functions of sorts, and source them in the script you want to use them in.