diff --git a/code/common.sh b/code/common.sh new file mode 100644 index 0000000..b6271c5 --- /dev/null +++ b/code/common.sh @@ -0,0 +1,8 @@ +#jq_to_array(jq_expression) +function _jq_to_array() { + declare -ga "_tmp=($(jq -r "$1" | sed 's/[][`~!@#$%^&*():;<>.,?\|{}=+-]/\\&/g;'"s@\\\'@\\'@g" ))" +} + +function format_numbers() { + rev | sed "s#[[:digit:]]\{3\}#&,#g" | rev | sed -E 's/^,//' +}