Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save peers8862/1c3fe4be849ba5056c9339cd5b55a021 to your computer and use it in GitHub Desktop.

Select an option

Save peers8862/1c3fe4be849ba5056c9339cd5b55a021 to your computer and use it in GitHub Desktop.
Using JRNL tool and aliases to save research to specific journals
#!/bin/bash
# Prompt the user for structured input
read -p "Topic: " topic
read -p "Importance: " importance
read -p "Discoveries: " discoveries
read -p "Connections: " connections
read -p "Technical Details: " technical
# Build the entry using a heredoc
entry=$(cat <<EOF
Research @GitHub
Topic: $topic
Importance: $importance
Discoveries: $discoveries
Connections: $connections
Technical: $technical
EOF
)
# Optional: Show the entry before saving
echo
echo "Entry preview:"
echo "$entry"
read -p "Submit? [y/N] " confirm
if [[ "$confirm" =~ ^[Yy]$ ]]; then
jrnl cd "$entry"
echo "✅ Entry saved."
else
echo "❌ Entry canceled."
fi
@peers8862
Copy link
Author

This Bash script utilizes the JRNL command line tool to log responses to a series of question on the command line. In this case the topic is coding and development related discoveries when working and researching on general topics. Aliases created in .bashrc for the alternative "JRNL journal" as well as a custom alias to initiate the series of questions. In this file the "cd" coding journal is named but this could be omitted to make entries save to the default environment variable journal. If an "export journal_file" alias is separately created to make all entries temporarily save to a specific journal then new entries via this script should save to the set journal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment