1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-11-05 04:29:03 -08:00
rc/sh/echo2
2021-08-01 08:41:31 -07:00

20 lines
401 B
Bash

#!/usr/bin/env sh
# YES_ZSH
# YES_BASH
# YES_DASH
echo2() { ### @-
### print arguments joined by spaces to stderr without parsing anything.
###
### ```
### $ echo -e 'this\nthat' those
### this
### that those
### $ echo2 -e 'this\nthat' those
### -e this\nthat those
### ```
local IFS=' '
printf "%s\n" "$*" >&2
}
[ "${SOURCING:-0}" -gt 0 ] || echo2 "$@"