Skip to content

Instantly share code, notes, and snippets.

@dannymcc
Created May 1, 2020 23:04
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 dannymcc/e33750369112ea93c90704cc0e0e44dc to your computer and use it in GitHub Desktop.
Save dannymcc/e33750369112ea93c90704cc0e0e44dc to your computer and use it in GitHub Desktop.
Basic bash diary
#!/bin/bash
if [ "$1" == "new" ]; then
FILENAME=$(date +"%d.%m.%Y")
vim $FILENAME &&
mcrypt -u $FILENAME
else
if [ $# -eq 1 ]; then
PTEXT=$(cat $1 | mcrypt -d) &&
echo $PTEXT | vim -R -
else
echo "Specify an input file."
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment