meme-tools

Meme format tools
git clone git://r-36.net/meme-tools
Log | Files | Refs | README | LICENSE

dir2meme (364B)


      1 #!/bin/sh
      2 
      3 if [ $# -gt 1 ];
      4 then
      5 	printf "usage: %s [dir]\n" "$(basename "$0")" >&2
      6 	exit 1
      7 fi
      8 
      9 printf "meme\n"
     10 find ${1:-.} -maxdepth 1 -type f \
     11 | while read -r medianame;
     12 do
     13 	case "${medianame}" in
     14 	*.meme|*.memeblob.*)
     15 		continue
     16 		;;
     17 	esac
     18 
     19 	filename="$(basename "${medianame}")"
     20 	memetag="${filename%.*}"
     21 	printf "#%s %s\n" "${memetag}" "${filename}"
     22 done
     23 
     24