Skip to content

Instantly share code, notes, and snippets.

@NobleUplift
Created September 5, 2015 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NobleUplift/aa55cd3a6ad9e9bab92f to your computer and use it in GitHub Desktop.
Save NobleUplift/aa55cd3a6ad9e9bab92f to your computer and use it in GitHub Desktop.
No idea what this was for. Needed it in 2011 for something...
#!/bin/sh
print_array() {
eval ARRAY=\${$1[*]}
echo ${ARRAY[*]}
for ELEMENT in ${ARRAY[@]}; do
echo $ELEMENT
done
}
QUEUE=( one two three )
#OLD_IFS=$IFS
#IFS=''
#NEW_QUEUE=(${QUEUE[*]})
print_array QUEUE
#IFS=$OLD_IFS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment