Skip to content

Instantly share code, notes, and snippets.

@al-maisan
Last active June 28, 2018 15:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save al-maisan/d48fc5cc2abe50f48b81b1c99d7121ed to your computer and use it in GitHub Desktop.
Save al-maisan/d48fc5cc2abe50f48b81b1c99d7121ed to your computer and use it in GitHub Desktop.
bash function to edit files with a time stamp
vdt() {
fname=${1:-gist.txt}
bname=`basename $fname`
ext=${bname#*.}
pfix=${fname%%.*}
gvim "${pfix}-`date +'%Y-%m-%d_%H-%M'`.${ext}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment