shithub: x

Download patch

ref: 96faac9c22974980466fa647e6dfcddfafea2919
parent: b03e483d77053c0d19c05f0fd2d87b6a083e8de2
author: kvik <kvik@a-b.xyz>
date: Tue Aug 6 10:06:47 EDT 2019

add x/vt

--- /dev/null
+++ b/mkfile
@@ -1,0 +1,16 @@
+BIN=$home/bin/rc
+MAN=/sys/man/1
+RC=path run mnt cd man vt
+
+install:V: $MAN/x rc
+
+$MAN/x: x.man
+	cp x.man $MAN/x
+
+rc:V:
+	mkdir -p $BIN/x
+	for(f in $RC) cp $f $BIN/x
+
+uninstall:V:
+	rm -rf $BIN/x
+	rm -f $MAN/x
--- /dev/null
+++ b/vt
@@ -1,0 +1,10 @@
+#!/bin/rc
+rpath=`{x/path -P}
+cmd=`{awk 'BEGIN{
+	x = ENVIRON["*"]
+	if(length(x) == 0)
+		x = "$SHELL"
+	printf("$SHELL -c ''cd %s; %s''",
+		ENVIRON["rpath"], x)
+}'}
+vt ssh -r `{x/path -l} $"cmd
--- a/x.man
+++ b/x.man
@@ -14,6 +14,9 @@
 .RB [ -l ]
 .I cmd
 .PP
+.B x/vt
+.RB [ cmd ]
+.PP
 .B x/man
 .RI [ section ] title
 .PP
@@ -105,6 +108,18 @@
 directory.
 
 .PP
+.B x/vt
+is similar to
+.B x/run
+except the
+.I cmd
+is run under the
+.IR vt (1)
+legacy teletype environment. If the
+.I cmd
+is missing a user's interactive $SHELL will be run.
+
+.PP
 .B x/man
 is a shortcut for displaying the manual pages from the remote
 systems.
@@ -137,6 +152,7 @@
 .SH EXAMPLES
 .SH SEE ALSO
 .IR ssh (1),
+.IR vt (1),
 .IR mntgen (4),
 .IR sshfs (4)
 .SH SOURCE