Skip to content

Instantly share code, notes, and snippets.

@jescalan
Created May 2, 2012 18:27
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jescalan/2578977 to your computer and use it in GitHub Desktop.
Save jescalan/2578977 to your computer and use it in GitHub Desktop.
Finalize
#!/bin/sh
# Installation instructions:
# - Download the file
# - mv finalize.sh finalize
# - chmod +x finalize
# - mv finalize /usr/local/bin
# - now you can type `finalize` in any directory and it should work
# NOTE: this will rename all the files in your current directory, so be careful
echo ""
echo "Are you TOTALLY SURE this is the final version? (y/n) => \c"
read answer
if [[ "$answer" == "y" ]]; then
for f in *; do mv "$f" "${f%.*}-final.${f##*.}"; done
echo "files finalized"
else
echo "welp, you'd better finalize that shit"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment