Skip to content

Instantly share code, notes, and snippets.

@SketchingDev
Created March 31, 2018 11:47
Show Gist options
  • Save SketchingDev/aecdb0698d6194f6587547e3cb4b4753 to your computer and use it in GitHub Desktop.
Save SketchingDev/aecdb0698d6194f6587547e3cb4b4753 to your computer and use it in GitHub Desktop.
Bash function for saving commands and their output to jrnl (http://jrnl.sh/)
#!/bin/bash
# Save commands/output to jrnl - the command line journal
# 1. Install jrnl (http://jrnl.sh/)
# 2. Reference this file, or copy the function, into your bash profile
function save(){
SAVE_COMMAND=$(echo "$@")
SAVE_OUTPUT=$($@)
echo "$SAVE_OUTPUT"
echo -e "$SAVE_COMMAND\n$SAVE_OUTPUT\n@terminal" | jrnl
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment