shithub: x

ref: b6a519453224239b129fa481f598946fe61e21c8
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@]host
.PP
.B x/run
.RB [ -l ]
.I cmd
.PP
.B x/man
.RI [ section ] title
.PP
.B x/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 /x
; mntgen /x
.EE
.SH COMMANDS
.PP
.B x/mnt
is a convenience wrapper around
.IR sshfs (4)
that connects to and 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.

.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
the command
.B x/run make
will run
.B make(1)
in the expected remote directory.

.PP
.B x/man
is a shortcut for displaying the manual pages from the remote
systems.
By default the manual pages are printed to the
standard output; the option
.I -p
changes this to redirect the output into a temporary file
.B /tmp/man/$title.$section.txt
which is then plumbed for viewing in an editor.

.PP
.B x/path
extracts and prints the information contained in the current
working path, it is used to implement other programs and can
be used in your own scripts.  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 mntgen (4),
.IR sshfs (4)
.SH SOURCE
.B git://code.a-b.xyz/x
.SH BUGS
Mhm.