Skip to content

Instantly share code, notes, and snippets.

@shearichard
Created August 30, 2022 03:59
Show Gist options
  • Save shearichard/3cbc66910848f30cbdb3bce3a54ffffc to your computer and use it in GitHub Desktop.
Save shearichard/3cbc66910848f30cbdb3bce3a54ffffc to your computer and use it in GitHub Desktop.
Shell script to create tmp output with date/time stamp
#!/bin/sh
#
# Pipe output from another command into this shell script
# and find the resulting output in a date/time stamped file
# in the tmp directory
#
# Eg
#
# $ ls -l | ./pipetotmp.sh
#
exec cat >/tmp/shea-work-$(date +"%y%m%dT%H%M%S.%3N").txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment