diff --git a/rc/bin/xargs b/rc/bin/xargs new file mode 100755 index 000000000..0387f2712 --- /dev/null +++ b/rc/bin/xargs @@ -0,0 +1,21 @@ +#!/bin/rc +fn usage { + echo usage: $0 [-n num] program [arguments] + exit usage +} +rfork e +ifs=' +' +nargs=1 +while(~ $1 -*) { + switch($1) { + case -n + nargs=$2 + shift 2 + case * + echo bla + usage + } +} +while(x = `{read -n $nargs}) + $* $x