Skip to content

Commit

Permalink
shpp: Output to stdout by using fd 1 directly
Browse files Browse the repository at this point in the history
/dev/stdout isn't available in all cases.

Signed-off-by: Björn Bidar <[email protected]>
  • Loading branch information
Thaodan committed Mar 26, 2023
1 parent 17bbc9f commit c9f3d99
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/shpp.in.sh
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ if [ ! $# = 0 ] ; then
-I) INCLUDE_SPACES=$2:$INCLUDE_SPACES; shift 2;;
-M) MACRO_SPACES=$2:$MACRO_SPACES; shift 2;;
-o|--output) target_name="$2"; shift 2 ;;
--stdout) target_name="/dev/stdout" ; shift ;;
--stdout) target_name="/dev/fd/1" ; shift ;;
# tells shpp to pass stder to $2
--stderr) exec 2> $2 ; shift 2;;
--) shift; break ;;
Expand Down Expand Up @@ -1024,7 +1024,7 @@ if [ ! $# = 0 ] ; then
fi
fi
if [ -z "$target_name" ] ; then
readonly target_name=/dev/stdout
readonly target_name=/dev/fd/1
__warning warning\
"using '/dev/stdout' as default output"
fi
Expand Down

0 comments on commit c9f3d99

Please sign in to comment.