Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Prior extending/addition of new functionality, did you let shellcheck check it?
I did copy-paste your fenced code into an editor (geany). Some of the indentations use tabulators, other explicit spaces. I recommend to stick either with one, or the other. Note, good editors allow you to use the tabulator key and -- on the fly the editor inserts (an adjustable number of) explicit spaces into the source code. In case of geany, this is available from the GUI via Edit -> Preferences, then Editor -> Indentation. Get in touch with your peers/colleagues, and adjust this accordingly (e.g., 2, 3, 4 spaces per tabulator key/indentation level; frequently either 2, or 4). Once if you all agree on a format in common, exchange, maintenance and collaboration (think e.g., GitLab/GitBucket/GitHub) is going to be considerably easier. (No, I don't know if there is bash code reformatter as e.g., fprettify for Fortran, yapf/black for Python [where indentation actually is functional], or rubocop for Ruby.)