I've currently got a bash script which checks for some dependencies and then executes some code which generates a pdf.
At the moment when the dependencies are checked my output looks like this:
CHECKING DEPENDENCIES:
4.3.33(1)-release.................................OK
wkhtmltopdf 0.12.1 (with patched qt)..............OK
jq-1.4............................................OK
The number of periods between the dependency name and the OK are hardcoded. As a result anyone running the script with different versions will have the OK
incorrectly justified as below.
CHECKING DEPENDENCIES:
4.3.33(1)-release.................................OK
wkhtmltopdf 0.11.0..............OK
jq-1.4............................................OK
I'm thinking that it may be easiest to create a separate function which is passed the name of the dependency and if it's ok or not. The function then prints out the name, the number of dots and the OK or NOK.
What I'm stumbling on is how to perform that dot count, and if there's an easier way to do it.