shithub: x

ref: 7760194f148720cc9d9432d47090ad4f1954a297
dir: x/run

View raw version
#!/bin/rc
rfork e
. /sys/lib/x/lib.rc
usage = '
	x/run [ssh-flags] command
'

flags=()
while(~ $1 -* && ! ~ $1 --){
	flags=($flags $1)
	shift
}
if(~ $1 --)
	shift

{
	echo cd `{x/path -P}
	if(! grep -s '/dev/cons' /fd/0ctl)
		cat
	if not
		echo $"*
}| ssh $flags `{x/path -l}