diff --git a/.scripts/FreeDoom.sh b/.scripts/FreeDoom.sh index 7d0d10a..a8cfd77 100755 --- a/.scripts/FreeDoom.sh +++ b/.scripts/FreeDoom.sh @@ -58,6 +58,7 @@ if [[ -e "${doomPath}/DoomMetalVol6.wad" ]]; then gameOption+=" ${doomPath}/DoomMetalVol6.wad" fi +set -o pipefail case ${buttonCode} in 1) # Death match setup @@ -115,10 +116,10 @@ case ${buttonCode} in '-extratic' '-dup' '3' ) fi - exec stdbuf -oL ${gzdoom} ${gameOption} "${flags[@]}" | stdbuf -oL grep "${grepStrings[@]}" | stdbuf -oL sed "${sedStrings[@]}" | spd-say -e + exec stdbuf -oL ${gzdoom} ${gameOption} "${flags[@]}" | while IFS= read -r l ; do echo "$l" | { grep "${grepStrings[@]}" | sed "${sedStrings[@]}" | spd-say -e; } || echo "$l";done ;; 0) - exec stdbuf -oL ${gzdoom} ${gameOption} | stdbuf -oL grep "${grepStrings[@]}" | stdbuf -oL sed "${sedStrings[@]}" | spd-say -e + exec stdbuf -oL ${gzdoom} ${gameOption} | while IFS= read -r l ; do echo "$l" | { grep "${grepStrings[@]}" | sed "${sedStrings[@]}" | spd-say -e; } || echo "$l";done ;; esac