4 ms·
I expect /usr/bin/echo to respond like this: Usage: /usr/bin/echo [SHORT-OPTION]... [STRING]... or: /usr/bin/echo LONG-OPTION Echo the STRING(s) to st
by ninalanyon 2y ago
I expect /usr/bin/echo to respond like this:
Usage: /usr/bin/echo [SHORT-OPTION]... [STRING]...
or: /usr/bin/echo LONG-OPTION
Echo the STRING(s) to standard output.
-n do not output the trailing newline
etc.
Were you thinking of the Bash builtin?
- enriquto 2y agoI don't expect any such ugly shit. A call to echo should print its arguments, no exceptions. NAME echo - echo arguments SYNOPSIS echo [ arg ... ] DESCRIPTION Echo writes its arguments in order as a line on the standard output file. It is mainly useful for producing diagnostics in command files.
- scubbo 2y agoExceptions to rules cause mental overhead and maintenance headaches. Why should `echo` be the single solitary tool that responds differently to invocation with `--help`?
- enriquto 2y agoLet me play the uno reverse card: why should "--help" be the single solitary string that echo does not print like the others?
- scubbo 2y agoFor two reasons, both related to the Principle of Least Astonishment: * Because the likelihood that someone entering `echo --help` _actually_ wants to print `--help` is staggeringly low * Because it's not the "single solitary string" that has special handling - `echo -n` does not print `-n`. `echo` already supports flags, and so it would be most-consistent and least-surprising for it to also support a standard default one