Puts
puts¶
Portable echo replacement that wraps printf. Supports a subset of echo flags (-e for escape sequences, -E to suppress them, -n/-end to suppress the trailing newline) plus -j to output a JSON key-value pair. Named 'puts' rather than overriding 'echo' because some shells protect their builtins.
Arguments¶
- $1 (string): Optional flag: -e, -E, -j, -n/--end, -en, -En, -ne, -nE
- $2 (string): Content to print (remaining args passed through)
Exit codes¶
- 0: Always
Output on stdout¶
- Formatted string per the selected mode