shithub: x

ref: 974c44891701926128d7bff0710c75fd14a931d9
dir: /x.man/

View raw version
.TH X 1
.SH NAME
x \- tools for dealing with alien systems
.SH SYNOPSIS
.PP
.B x/mnt
[ [
.I user@
]
.I host
]
.PP
.B x/run
.RB [ -l ]
.I cmd
.PP
.B x/vt
.RB [ cmd ]
.PP
.B x/man
.RI [ -b ]
.RI [ man-flags ]
.RI [ section ]
.I title
.PP
.B x/path
.B -lpPr
[
.I path
]
.SH DESCRIPTION
.PP
.I X
is a collection of programs that tries to enable convenient
interaction with alien systems of the UNIX® variety from the
extreme comfort of Plan 9.
.PP
These programs rely on the namespace convention whereupon the
root hierarchy of the remote system to be interacted with is
mounted, usually through
.IR sshfs (4),
at the
.IR mntgen (4)
provided mountpoint under
.I /x
named after the
.B user@host
login tuple used to mount the system.
.PP
In this way the working directory of a program is loaded with
two bits of information about the remote system: the login
that can be used to access it, and the path relative to the
remote root - which are exploited by the programs described
here to provide some further convenience.
.SH SETUP
.PP
Create the
.I /x
directory on your root file server and make sure to have the
.IR mntgen (4)
started somewhere convenient, perhaps in your profile:
.EX
; mount -c /srv/boot /n/boot
; mkdir /n/boot/x
; mntgen /x
.EE
.SH COMMANDS
.PP
.B x/mnt
is a convenience wrapper around
.IR sshfs (4)
that mounts the remote
.I host
as 
.I user
to the appropriate place as discussed above.
If
.I user
is missing,
.B x/mnt
tries the mount as both the invoking user and as
.I root.
If both the
.I user
and
.I host
are missing, it attempts to mount the system suggested by the
current working directory.

.PP
.B x/run
uses
.B ssh(1)
to connect to and run the
.I cmd
on the system suggested by the current path;
.B cd(1)
will be prepended to the command to execute it in the correct
context.  For example, given the current directory
.B /x/me@moskvax/home/me/prog
running
.B x/run make
will execute
.B make(1)
as user
.I me
on system
.I moskvax
in the
.B /home/me/prog
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
displays formatted manual pages from remote systems on its
standard output.
With
.I -b
the page is saved to a file and plumbed.

.PP
.B x/path
extracts and prints the information embedded in the pathname
of the working directory or the one given as the last
argument.
The options are as follows:
.TF "-o option"
.TP
.I -l
prints the login, i.e. the user@host string that can be used
to connect to the remote system.
.TP
.IR -P , -p
print the absolute (relative) path relative to the remote
root.
.TP
.I -r
prints the local path to the root of the remote hierarchy.

.SH EXAMPLES
.SH SEE ALSO
.IR ssh (1),
.IR vt (1),
.IR mntgen (4),
.IR sshfs (4)
.SH SOURCE
.B git://code.a-b.xyz/x
.SH BUGS
Mhm.