Dotfiles, utilities, and other apparatus.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
561 B

  1. #!/bin/sh
  2. if [ ! -z "$1" ]; then
  3. # Take the basename of the file passed in, i.e. something like
  4. # /home/brennen/notes/vimwiki/diary/2019-01-01.wiki, slice off the extension,
  5. # and treat it as a seed date:
  6. date="$(basename -s .wiki "$1")"
  7. date="$(basename -s .md "$date")"
  8. datestamp="$(date --date="$date" -I)"
  9. else
  10. # No filename given, nothing to work with, just use today:
  11. datestamp="$(date -I)"
  12. fi
  13. echo '== log =='
  14. echo
  15. echo "{{{exec-raw find ./vimwiki/log -name '${datestamp}*.wiki' | sort | xargs grep --with-filename '%title'"
  16. echo '}}}'