I am not showing much code here , but I have a requirement to fix. We have file with over 100 function that are being used in various shell scripts in production. We have named it as.
functions.sh
Up-till now each script call this "functions.sh" file in it so it can access the updated function. Like this
#!/bin/bash
# comment
# comment
# Comment
./path/function.sh
echo "Date" > logging()
..
Now we have been asked to get rid of this call :
./path/function.sh
from scripts that will be developed in future. (so that more such files can be added) & make sure latest functions are automatically refreshed in environment as soon as new "functions.sh" is deployed to production and any scripts can use the function defined in them directly . Shall I just call it in .bashrc file as
~/.functions.sh
or is there anything else we have to do , keeping in mind scripts will be executed in non-interactive mode through crontab. ( all scripts are bash scripts ) any help is appreciated.
Thanks
~/.functions.sh
or did you actually mean. ~/.functions.sh
? We would also need to know your OS since some details may change.