shithub: bin.rc

ref: 32dae5e4a11c5d7876ce45d221930f84d37e83e2
dir: /bin/wrap/

View raw version
#!/bin/rc
rfork e
fn usage {>[1=2] echo 'usage:' $usage && exit 'usage'}
usage='wrap start [end]'

while(~ $1 -* && ! ~ $1 --){
	switch($1){
	case *
		usage
	}
	shift
}
if(~ $1 --)
	shift
if(~ $#* 0)
	usage
	
s0 = $1
s1 = $2
if(~ $#* 1)
	s1 = $s0
echo -n $s0
cat
echo -n $s1