Skip to content

Instantly share code, notes, and snippets.

@linhxhust
Created May 9, 2017 00:56
Show Gist options
  • Save linhxhust/dd86c3e4b99c3e2d7b043776aeb6cb0b to your computer and use it in GitHub Desktop.
Save linhxhust/dd86c3e4b99c3e2d7b043776aeb6cb0b to your computer and use it in GitHub Desktop.
#!/bin/bash
cdr_array=(
"rec:/path/to/cdr/rec"
"sms:/path/to/cdr/sms"
"mgr:/path/to/cdr/mgr"
"vou:/path/to/cdr/vou"
)
for cdr in "${cdr_array[@]}" ; do
key="${cdr%%:*}"
value="${cdr##*:}"
printf "cdr_array[%s] => %s\n" "$key" "$value"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment