Skip to content

Instantly share code, notes, and snippets.

@zendeavor
Created July 6, 2012 19:54
Show Gist options
  • Save zendeavor/3062413 to your computer and use it in GitHub Desktop.
Save zendeavor/3062413 to your computer and use it in GitHub Desktop.
funky array test
#!/bin/bash
while read -d '' -r files; do
img="${files#*2012/}"
case "$img" in
*+(jpe+(g))*)
set -x
img_name="${img##*/}"
img_name="${img_name%.*}"
echo "$img"
jpeg_dir[$img_name]=("${img}")
echo "${jpeg_dir[@]:(-1)}"
;;
esac
done < <(find "$files_path" -type f -print0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment