Skip to content

Instantly share code, notes, and snippets.

@alexreg
Created July 25, 2013 04:08
Show Gist options
  • Save alexreg/6076839 to your computer and use it in GitHub Desktop.
Save alexreg/6076839 to your computer and use it in GitHub Desktop.
array_cp() {
local _a="$1[i]" _b="$2[i]" _na i
eval _na=\${!$1[@]} $2=()
for i in $_na ; do
eval $2[i]=${!_a}
done
}
-bash: syntax error near unexpected token `('
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment