Plan 9 from Bell Labs’s /usr/web/sources/contrib/anothy/bin/rc/snip

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


#!/bin/rc

rfork e

if (~ $snipserv '')
	snipserv=9srv.net

srv -cnmq tcp!$snipserv!17037 $snipserv^!snip /n/$snipserv^!snip || {
	echo 'can''t mount snippet service' >[1=2]
	exit mountsnip
}

target=/n/$snipserv^!snip/$user.$pid


switch($#*){
	case 0
		ls /n/$snipserv^!snip
	case 1
		cp $1 $target && echo $target || echo error: $status
	case *
		for (i in $*)
			snip $i
}

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].