I have the following command:
xargs -d '\n' -n 8 bash -c 'phpcs_element PSR2 "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8"' -- >&2 2>/dev/null
If I run this command into Linux it will work, if I try to run in into Mac OSX will not because the OSX xargs doesn't know about xargs -d (delimiter).
xargs: illegal option -- d
usage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements] [-S replsize]]
[-J replstr] [-L number] [-n number [-x]] [-P maxprocs]
[-s size] [utility [argument ...]]
Have anyone found a workaround for this issue?
Xargs Version: src/usr.bin/xargs/strnsubst.c,v 1.7 2004/10/18 15:40:47
Thanks in advice.
>&2 2>/dev/null
is what you want? It first copies the original stderr file descriptor to stdout, and then makes stderr go to /dev/null -- so in the end, stdout still gets written (but to stderr), and stderr doesn't get written at all. If what you really want is neither stdout or stderr to be written, you need to do those same operations in the opposite order:>/dev/null 2>&1
. – Globate