Scientific calculator with math syntax that supports user-defined variables and functions, complex numbers, and estimation of derivatives and integrals
When launched without any arguments, kalk will write a banner and a help hint to standard output. This is counter productive when kalk is used as a filter, because you cannot easily use the output from kalk in a pipe — even when output is a file, the banner/help is irrelevant.
Without thinking it through completely, I think kalk could just check if stdin and stdout are TTYs (isatty(3)) and only display banner/help if they both are: when reading expressions from stdin, stdin is not a TTY, and when writing to a pipe or a file, stdout is not a TTY.
When launched without any arguments,
kalk
will write a banner and a help hint to standard output. This is counter productive whenkalk
is used as a filter, because you cannot easily use the output from kalk in a pipe — even when output is a file, the banner/help is irrelevant.Without thinking it through completely, I think
kalk
could just check if stdin and stdout are TTYs (isatty(3)
) and only display banner/help if they both are: when reading expressions from stdin, stdin is not a TTY, and when writing to a pipe or a file, stdout is not a TTY.