* add common functions file (oops)
This commit is contained in:
parent
b7e8d58dc6
commit
964c410a7e
8
code/common.sh
Normal file
8
code/common.sh
Normal file
|
@ -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/^,//'
|
||||||
|
}
|
Loading…
Reference in a new issue