|
|
|
|
|
by e12e
2167 days ago
|
|
It's a little sad that standard shell here documents only support elliding leading tabs (it wouldn't be so sad if the record separator hadn't been thrown under the bus - having a character for indentation distinct from space is good... In theory). But at any rate my typical usage() is generally along these lines (warning watch out for expansions): usage()
{
cat - <<-EOF
`basename ${0}`: demonstrate here docs
Usage:
`basename ${0}` <required argument> [-o|--optional-param]
Etc. Possibly referencing
default value: ${DEFAULT_VALUE}
EOF
}
|
|