« Path Parser and Permissions Previewer Utility for Unix | Main | RSA data length limits »

sgrax - xargs backwards

sgrax - converts argument list to standard input for a named command. Opposite of xargs(1). Handy on (rare) occasion. Okay, very rare.

#!/bin/sh if [ -z "$1" ]; then echo "Usage: `basename $0` command data for standard input ..." >&2 exit 1 fi COMMAND=$1 shift echo "$@" | $COMMAND