Skip to content

Instantly share code, notes, and snippets.

@kellyp
Last active December 24, 2015 12:59
Show Gist options
  • Save kellyp/6801238 to your computer and use it in GitHub Desktop.
Save kellyp/6801238 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ $# -eq 0 ]
then
echo "Please supply the name of the gem to timestamp"
exit
fi
file=`ls -t $1-*.gem`
new_file="${file//gem/$(date +"%Y%m%d%H%M%S").gem}"
echo "Renaming $file to $new_file"
mv $file $new_file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment