1 # $FreeBSD: head/bin/sh/tests/expansion/cmdsubst24.0 317347 2017-04-23 21:58:17Z jilles $
2 # POSIX leaves the effect of NUL bytes in command substitution output
3 # unspecified but we have always discarded them.
8 if [ "$2" != "$3" ]; then
9 printf "Failed at line %s: got \"%s\" expected \"%s\"\n" "$1" "$2" "$3"
14 fmt='\0a\0 \0b\0c d\0'
15 assign_builtin=$(printf "$fmt")
16 check "$LINENO" "$assign_builtin" "a bc d"
17 assign_pipeline=$(printf "$fmt" | cat)
18 check "$LINENO" "$assign_pipeline" "a bc d"
19 set -- $(printf "$fmt") $(printf "$fmt" | cat) "$(printf "$fmt")" "$(printf "$fmt" | cat)"
22 check "$LINENO" "$splits" "a@bc@d@a@bc@d@a bc d@a bc d"