Last active
March 26, 2023 20:51
-
-
Save albingeorge/e334eb3e33e76c5f2169d0b2b6477130 to your computer and use it in GitHub Desktop.
Logs the input string to a dropbox directory and syncs across your devices
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Logs the data to the dropbox directory | |
# Usage | |
# w "Created README" | |
# If no arguments are passed, it shows the last 20 entries | |
w() { | |
filename=~/Dropbox/tracker/$(date +%Y_%m_%d.log) | |
if [[ $# -eq 0 ]] ; then | |
tail -n 20 $filename | |
else | |
content="$(date +%H:%M:%S) - ${@}" | |
echo "$content" >> $filename | |
fi | |
} | |
# Opens today's work in Sublime | |
w_edit(){ | |
filename=~/Dropbox/tracker/$(date +%Y_%m_%d.log) | |
subl $filename | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment