shithub: bin.rc

ref: 17ffc25b2303538e71895e660fce6640d5b1dc3b
dir: /bin/local/

View raw version
#!/bin/rc -e

if(~ $#ws 0)
	ws=/tmp
while(~ $1 -* && ! ~ $1 --){
	switch($1){
	case -r
		. $ws/mounts
		plumb 'Local . '$ws'/mounts'
		exit
	case -e
		shift
		var=$1
		shift
		plumb 'Local echo -n '$"*' >/env/'$var
		exit
	}
	shift
}
if(~ $1 --)
	shift

echo $"* >>$ws/mounts 
uniq $ws/mounts >$ws/mounts.q
mv $ws/mounts.q $ws/mounts

eval $* && plumb 'Local '$"*