Skip to content

Instantly share code, notes, and snippets.

@maesoser
Created February 24, 2020 08:57
Show Gist options
  • Select an option

  • Save maesoser/11a2a9109aa3369eb1eab4a6e2eadb3d to your computer and use it in GitHub Desktop.

Select an option

Save maesoser/11a2a9109aa3369eb1eab4a6e2eadb3d to your computer and use it in GitHub Desktop.
function diario {
DATESTR=$(date +%d%m%Y)
FILENAME="/Users/maesoser/diario/entry_$DATESTR.txt"
if [[ -f "$FILENAME" ]]; then
nano $FILENAME
else
touch $FILENAME
echo -e "------------------------------------------------\n" >> $FILENAME
echo " Entrada $(date '+%A %d-%B, %Y')" >> $FILENAME
echo -e "\n------------------------------------------------\n" >> $FILENAME
nano $FILENAME
echo -e "\n------------------------------------------------" >> $FILENAME
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment