Getting started with sh
$ echo Hello, world! Hello, world!
$ printf 'Hello, world!\n' Hello, world!
As a file:
#!/bin/sh printf '%s\n' 'Hello, world!'
$ for shell in ash bash dash ksh ksh93 zsh; do > $shell -c "echo '\\\\'$shell'\\\\'" > done \\ash\\ \\bash\\ \dash\ \pdksh\ \\ksh93\\ \zsh\
’echo’ can only be used consistently, across implementations, if its arguments do not contain any backslashes (reverse-solidi), and if the first argument does not start with a dash (hyphen-minus). Many implementations allow additional options, such as
-e, even though the only option allowed is
-n (see below).
If the first operand is -n, or if any of the operands contain a
character, the results are implementation-defined.