Skip to content

Instantly share code, notes, and snippets.

@enorms
Created January 8, 2023 05:14
Show Gist options
  • Save enorms/0d2698dd7aa9caad4368c44f3813990c to your computer and use it in GitHub Desktop.
Save enorms/0d2698dd7aa9caad4368c44f3813990c to your computer and use it in GitHub Desktop.
print and copy date with fun confirmation line in color and emoji (macos zshell)
#!/bin/zsh
grn="$(tput setaf 2)"
didcopymsg='๐Ÿ‘† copied to clipboard ๐Ÿ“‹ โœ… ๐Ÿถ'
alias copy="tr -d '\n' | pbcopy"
alias DATE='echo "$(date '\''+%F %T %Z'\'')" | tee /tmp/output.txt; cat /tmp/output.txt | copy; rm /tmp/output.txt; echo "$grn $didcopymsg"'
DATE
# 2023-01-07 21:08:53 PST
# ๐Ÿ‘† copied to clipboard ๐Ÿ“‹ โœ… ๐Ÿถ
@enorms
Copy link
Author

enorms commented Jan 8, 2023

would welcome input on making this work with bash, and a multi-platform shebang

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