GitHub
02/07/2023, 4:19 PM#!/usr/bin/env bash
set -o pipefail
echo <<HEREDOC > test.tcl
exit -1
HEREDOC
cat /dev/null | magic -dnull -noconsole ./test.tcl
echo "Exit code: $?"
echo "exit -1" | magic -dnull -noconsole
echo "Exit code: $?"
While the second one does indeed print 255
, the first one simply prints 0
. Additionally, without piping /dev/null, the first one continues to offer a prompt as if nothing has happened. Is there a way around this behavior?
RTimothyEdwards/magic