Skip to content

Instantly share code, notes, and snippets.

@hivehand
Created February 12, 2015 00:38
Show Gist options
  • Save hivehand/6e5a8b6b4c751e6770c9 to your computer and use it in GitHub Desktop.
Save hivehand/6e5a8b6b4c751e6770c9 to your computer and use it in GitHub Desktop.
Mac-only bash function to push a personalized datestamp into the paste buffer.
function pds {
local user_name=$(dscl . read /Users/$(whoami) RealName | grep -v RealName | \
cut -c 2- | sed -E 's/ ([^ ])[^ ]*$/ \1/')
echo "[$user_name, $(date +%F)]" | pbcopy
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment