mrsh icon indicating copy to clipboard operation
mrsh copied to clipboard

Function output cannot be redirected

Open subnut opened this issue 4 years ago • 1 comments

$ hello() { HI=0xDEADBEEF; echo $HI; }
$ hello > /dev/null
0xDEADBEEF
$ exit

Expected output -

$ hello() { HI=0xDEADBEEF; echo $HI; }
$ hello > /dev/null
$ exit

subnut avatar Feb 06 '22 16:02 subnut

This is really bad. I have a script running something like this:

while read -r word; do
    : work
done <<EOF
$(call_function)
EOF

and it just gets stuck at this part.

9ao9ai9ar avatar Jan 02 '25 22:01 9ao9ai9ar