plan9port/lib/moveplan9.sh

31 lines
417 B
Bash
Raw Normal View History

#!/bin/sh
2005-09-13 00:22:50 +00:00
case $# in
0)
old=/usr/local/plan9
;;
1)
old=`cleanname $1`
;;
*)
echo 'usage: moveplan9.sh [oldpath]' 1>&2
exit 1
2005-09-13 02:39:54 +00:00
esac
2005-09-13 00:22:50 +00:00
new=`cleanname $PLAN9_TARGET`
2005-09-13 00:22:50 +00:00
if [ X"$new" = X"" ]
then
echo cleanname failed 1>&2
2005-09-13 00:22:50 +00:00
exit 2
fi
cd $PLAN9
2006-12-10 00:19:46 +00:00
# Avoid broken builtin echo in dash that turns \1 into ^A
`which echo` '
X ,s;'$old'($|/|});'$new'\1;g
X/'"'"'/w
q
' | sam -d `cat lib/moveplan9.files` >/dev/null 2>&1