Replaced rsc with a bash version without remote dependencies.
[utils.git] / rsc
... / ...
CommitLineData
1#!/bin/bash
2
3set -e
4
5if [ $# -lt 2 ]; then
6 echo "usage: rsc HOST COMMAND ARGS..." >&2
7 exit 1
8fi
9
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 \"\$@\"'"