Created
September 11, 2022 04:28
-
-
Save manugupt1/19db623c5cb3cc11a2cb58f23a176ba5 to your computer and use it in GitHub Desktop.
This file contains 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 -x | |
set -euo pipefail | |
exec 5<> $PWD/CONTAINER_WAIT | |
exec 3<> $PWD/CONTAINER_STDOUT | |
exec 4<> $PWD/CONTAINER_STDERR | |
truncate -s 0 /tmp/logger | |
truncate -s 0 /tmp/stdout | |
echo $PWD >> /tmp/logger | |
ls $PWD >> /tmp/logger | |
sleep 2 | |
exec 5>&- | |
rm $PWD/CONTAINER_WAIT | |
for i in {1..5} | |
do | |
read -u 3 stdout | |
cat $stdout>>/tmp/stdout | |
# echo ${LINE} >>/tmp/stderr | |
sleep 1 | |
done | |
exec 3>&- | |
exec 4>&- | |
rm $PWD/CONTAINER_STDERR | |
rm $PWD/CONTAINER_STDOUT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment