plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

moveplan9.sh (417B)


      1 #!/bin/sh
      2 
      3 case $# in
      4 0)
      5 	old=/usr/local/plan9
      6 	;;
      7 1)
      8 	old=`cleanname $1`
      9 	;;
     10 *)
     11 	echo 'usage: moveplan9.sh [oldpath]' 1>&2
     12 	exit 1
     13 esac
     14 
     15 new=`cleanname $PLAN9_TARGET`
     16 
     17 if [ X"$new" = X"" ]
     18 then
     19 	echo cleanname failed 1>&2
     20 	exit 2
     21 fi
     22 
     23 cd $PLAN9
     24 # Avoid broken builtin echo in dash that turns \1 into ^A
     25 `which echo` '
     26 	X ,s;'$old'($|/|});'$new'\1;g
     27 	X/'"'"'/w
     28 	q
     29 ' | sam -d `cat lib/moveplan9.files` >/dev/null 2>&1
     30