Plan 9 from Bell Labs’s /usr/web/sources/patch/applied/replica-mkdir-p/setupdirs.backup

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


#!/bin/rc

rfork en

if(! ~ $#libreplica 1)
	libreplica=$home/lib/replica

fn usage {
	echo 'usage: replica/setupdirs' >[1=2]
	exit usage
}

fn fatal {
	echo $* >[1=2]
	exit $"*
}

fn must {
	$* || fatal $"*^': '^$status
}

if(! ~ $#* 0)
	usage

for (i in \
	$libreplica\
	$libreplica/db\
	$libreplica/db/client\
	$libreplica/db/server\
	$libreplica/log\
	$libreplica/cfg)
	if(! test -d $i)
		must mkdir $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 webmaster@9p.io.