Suppress printing methods in a piped script

Just use julia - to treat stdin as a script rather than as interactive inputs. e.g. with your heredoc example:

% cat <<EOF | julia -
foo() = 1
EOF

gives no output. (This is a standard Unix idiom.)

3 Likes