Created
April 22, 2016 12:52
-
-
Save erkiesken/fac3ff21316670dca160a4d916dfd6f7 to your computer and use it in GitHub Desktop.
Bash script output to stdout and teed to a file
This file contains hidden or 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 | |
set -exuo pipefail | |
# Taken from https://alestic.com/2010/12/ec2-user-data-output/ | |
exec > >(tee ./tmp.log) 2>&1 | |
echo BEGIN | |
ls -lah . | |
echo END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment