rwd man page on Plan9

Man page or keyword search:  
man Server   549 pages
apropos Keyword Search (all sections)
Output format
Plan9 logo
[printable version]

RWD(1)									RWD(1)

       rwd, conswdir - maintain remote working directory

       rwd path

       conswdir [ prog ]

       Rwd and conswdir conspire to keep rio(4) and acme(4) informed about the
       current directory on remote systems during  login  sessions.   Rio  and
       acme include this information in plumb messages sent to plumber(4).  If
       the remote system's name space is mounted in the plumber's name	space,
       the  end	 result	 is  that  file	 paths	printed during the session are

       Rwd informs rio and acme of directory changes.  The name of the	remote
       machine	is taken from the environment variable $remotesys.  Rwd writes
       the full path to /dev/wdir; writes the last element of the  path,  suf‐
       fixed  by  @remotesys,  to  /dev/label;	and when run inside a win (see
       acme(1)) window, changes the  window  title  to	path/-remotesys	 using

       Conswdir	 copies standard input to standard output, looking for in-band
       messages about directory changes.  The messages are of the form:


       where \033 and \007 are ASCII escape and bell  characters.   Such  mes‐
       sages  are  removed from the stream and not printed to standard output;
       for each such message conswdir runs prog (default /bin/rwd)  with  path
       as its only argument.

       Add  this  plumbing rule (see plumb(6)) in order to run commands in the
       plumber's name space:

	      # have plumber run command
	      kind is text
	      data matches 'Local (.*)'
	      plumb to none
	      plumb start rc -c $1

       Mount a Unix system in your name space and the plumber's:

	      % 9fs unix
	      % plumb 'Local 9fs unix'

       (If you're using acme, execute Local 9fs unix with the middle button to
       mount the Unix system in acme's name space.)

       Connect	to  the	 Unix system, processing in-band directory change mes‐

	      % ssh unix | aux/conswdir

       Add this shell function to your .profile on the Unix system to generate
       directory change messages every time a cd command is executed:

	      H=`hostname | sed 's/\..*//'`
	      _cd () {
		   \cd $* &&
		   case $- in
			echo /n/$H$_dir | awk '{printf("\033];%s\007", $1);}'
	      alias cd=_cd

       The  examples  described so far only help for relative path names.  Add
       this plumbing rule to handle rooted names like /usr/include/stdio.h:

	      # remote rooted path names
	      type is text
	      wdir matches '/n/unix(/.*)?'
	      data matches '/([.a-zA-Z¡-0-9_/\-]*[a-zA-Z¡-0-9_/\-])('$addr')?'
	      arg isfile /n/unix/$1
	      data set $file
	      attr add addr=$3
	      plumb to edit
	      plumb client window $editor


       plumber(4), plumb(6), srv(4)

       This mechanism is clunky, but Unix and SSH make it hard to build a bet‐
       ter one.

       The  escape  sequence  was chosen because it changes the title on xterm

                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server Plan9

List of man pages available for Plan9

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net