1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-06-29 02:17:12 -07:00
rc/sh/echo2
2021-08-01 08:41:31 -07:00

21 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 "$@"