netpwd   [plain text]

#! /bin/sh
# Copyright 2002 Free Software Foundation
# by Alexandre Oliva <>

# This script is Free Software, and it can be copied, distributed and
# modified as defined in the GNU General Public License.  A copy of
# its license can be downloaded from

# Turn a local pathname into a network-neutral one.  It assumes
# /net/$HOSTNAME/pathname can access $HOSTNAME's /pathname from other
# machines, and that /net/$HOSTNAME is actually mounted (by amd)
# inside /.automount/$HOSTNAME/root, so it compensates for that.

case $dir in
  dir=/net/`echo "$dir" |  sed -e '1s,^/\.automount/,,' -e 's,/root/,/,'`
  dir=/net/${HOSTNAME-`uname -n`}$dir
echo $dir
exit 0