Plan 9 from Bell Labs’s /usr/web/sources/contrib/mjl/u9fs-setup

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/rc

cmd=()
quotes=''

fn usage {
	echo usage: u9fs-setup [-q] cmd args >[2=1]
	exit 1
}

fn error {
	echo error: $* >[2=1]
	exit 1
}

while(! ~ $#* 0 && ~ $1 -*) {
	switch($1) {
	case --
		shift
		break
	case -q
		shift
		quotes=''''$quotes
	case *
		usage
	}
}

if(~ $#* 0){
	usage
}

shcmd='echo setting up $HOME/bin/u9fs on `hostname`;
	mkdir tmp 2>/dev/null;
	cd tmp && tar -zxf - && cd u9fs && make >/dev/null || exit 1;
	mkdir $HOME/bin 2>/dev/null;
	cp u9fs $HOME/bin || exit 1;
	rm -r $HOME/tmp/u9fs
	ls -l $HOME/bin/u9fs;
	exit 0'

@{cd /sys/src/cmd/unix && tar -c u9fs} | gzip | $* $quotes^$shcmd^$quotes || exit nomagictoday
echo
echo do not forget to update ssh9fs

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].