Plan 9 from Bell Labs’s /usr/web/sources/contrib/nemo/rc/bin/bfs

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


#!/bin/rc
# Helper to mount Plan B volumes that we know about
# 

switch($#*){
case 0
	grep -v '^#' /dev/vol | awk '{printf("bfs %s\n",  $4);}'  | sort | uniq
case 1
	# These volumes are unions:
	if (~ $1 /devs/ui &&) {
		if (! { ns | grep '/devs/ui' } >/dev/null >[2=1])
			exec mount -bc /srv/vol /devs '*/devs/ui user='^$user
		exit ''
	}
	if (~ $1 /what )
		exec mount -c /srv/vol /what '*/what'
	# Dont mount kbd/mouse because they are already mounted
	# and we do not want to loose them.
	if (! ~ $1 / /dev/kbd /dev/mouse)
		exec mount -c /srv/vol $1 $1 
	exit ''
case 2
	switch($1){
	case /dev/kbd
		;
	case /dev/mouse
		;
	case *
		exec mount -c /srv/vol $1 $1^' '^$2 
	}
case *
	echo 'usage: bfs name [spec]' >[1=2]
	exit usage
}


exit ''

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.