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

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


#!/bin/rc

if (! test -e /srv/vol){
	# old plan b
	{
		echo '# '
		ns | grep '^# '
	} | sed 's/..//'
	exit ''
}
# The spec strings we use break ns(1), which assumes that spec
# does not contain white spaces.
vols=`{cat /proc/$pid/ns | grep '^mount'| grep ' (#s/vol|/srv/vol) ' |
	sed -e 's|.*#s/vol +||' -e 's|-[TUM]+ ||' |
	awk '{print $2}' | sed 's/^[!*]//' |
	grep -v '^$' | sort | uniq}
for (v in $vols) {
	ls $v >/dev/null >[2=1]
	fs=`{grep  '^# '^$v^'	' /dev/vol | 
		sed -e 's/.*\[//' -e 's/].*//' | sed 1q}
	if (~ $#fs 0)
		fs=none
	echo $v^'	'^$"fs
}



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.