diff options
-rw-r--r-- | research/return-string-without-subshell.sh | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/research/return-string-without-subshell.sh b/research/return-string-without-subshell.sh new file mode 100644 index 0000000..a321e51 --- /dev/null +++ b/research/return-string-without-subshell.sh @@ -0,0 +1,39 @@ +greeting() +{ + return 'Hello' +} + +party() +{ + return 'World' +} + +main() +{ + echo $[greeting] $[party] + + return 0 +} + +### + +greeting() +{ + __retval0='Hello' + ! [ x'Hello' = x ] && ! [ x'Hello' = xfalse ] || [ x'Hello' = x0 ] +} + +party() +{ + __retval0='World' +} + +main() +{ + greeting + party + echo ${__retval0} ${__retval0} + + __retval0=0 + ! [ x0 = x ] && ! [ x0 = xfalse ] || [ x0 = x0 ] +} |