set -x
set -e
set -o pipefail
# Test stdout stream
# Skip empty lines
ID=$(journalctl --new-id128 | sed -n 2p)
>/expected
ID=$(journalctl --new-id128 | sed -n 2p)
>/expected
# Remove trailing spaces
ID=$(journalctl --new-id128 | sed -n 2p)
ID=$(journalctl --new-id128 | sed -n 2p)
# Don't remove leading spaces
ID=$(journalctl --new-id128 | sed -n 2p)
ID=$(journalctl --new-id128 | sed -n 2p)
# Don't lose streams on restart
sleep 3
sleep 3
[[ ! -f "/i-lose-my-logs" ]]