Create a gist now

Instantly share code, notes, and snippets.

@smirzai /
Created Dec 15, 2017

What would you like to do?
A small script to create my daily report file
# this script checks the $base_path folder
# if there is no dailr report for today, it will create it and replace the %current-date% to current date
# in any case, it returns the file name which makes it suitable for a command like:
# emacs `dr`
read Y M D MM <<< $(date +'%Y %m %d')
if [ ! -e "$full_path" ]; then
sed "s/%current-date%/$Y-$M-$D/g" < "$template_full_path" > "$full_path"
echo $full_path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment