Skip to content

Instantly share code, notes, and snippets.

@bohnna
Forked from jescalan/finalize.sh
Created April 11, 2016 14:58
Show Gist options
  • Save bohnna/3b3dad94cad607a6381fe49b92d0a048 to your computer and use it in GitHub Desktop.
Save bohnna/3b3dad94cad607a6381fe49b92d0a048 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