Skip to content

Instantly share code, notes, and snippets.

@achiku
Created September 7, 2019 03:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save achiku/86bfd8839ececd959edcf5ac8b611422 to your computer and use it in GitHub Desktop.
Save achiku/86bfd8839ececd959edcf5ac8b611422 to your computer and use it in GitHub Desktop.
#!/bin/bash
# $ for i in $( find -E ~/Documents/howm/achiku -type d -regex ".*/achiku/[0-9]{4}/[0-9]{2}"); do ./howm2memolist.sh $i; done
p=${1}
for i in $( ls $p ); do
title=$( sed -n '1p' ${1}/${i} | sed -e 's/^# //' -e 's;/;;g')
n=$( echo ${i} | sed -E -e 's/([0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{4})[0-9]{2}.md/\1/' )
cp ${1}/${i} "/Users/chiku/Documents/memolist/achiku/${n}-${title}.md"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment