17 lines
400 B
Plaintext
Raw Normal View History

2017-06-17 20:55:56 -06:00
#!/usr/bin/env bash
set -e
LOG_FILE=./jobs.log
touch ${LOG_FILE}
UUID="xxxxxxxxxxxxxxxxx"
exec > >(read message; echo "$(date) ${UUID} [info] $message" | tee -a ${LOG_FILE} )
exec 2> >(read message; echo "$(date) ${UUID} [error] $message" | tee -a ${LOG_FILE} >&2)
echo "Start"
docker run alpine sh -c 'while :; do echo "ping"; sleep 1; done'
# [error] write /dev/stdout: broken pipe
echo "End"