Replaced rsc with a bash version without remote dependencies.
[utils.git] / rsc
CommitLineData
58f76900 1#!/bin/bash
df499390 2
58f76900 3set -e
535cc97f 4
58f76900
FT
5if [ $# -lt 2 ]; then
6 echo "usage: rsc HOST COMMAND ARGS..." >&2
7 exit 1
8fi
df499390 9
58f76900
FT
10host="$1"; shift
11cmd="$1"; shift
12
13(
14 echo -n "$cmd"; echo -ne '\0'
15 for arg in "$@"; do
16 echo -n "$arg"; echo -ne '\0'
17 done
18) | exec ssh "$host" "xargs -0x sh -c 'exec \$0 \"\$@\"'"