shithub: rc

ref: 8b15a2b04136a915466309e919ebdf0ff7906f9e
dir: /bin/r/

View raw version
#!/bin/rc
rfork e
x=1
if(! ~ $#* 0)
	x=$1
awk -v 'x='^$x '
/^; /{
	a[++n] = NR
} END {
	cmd = a[n-x]","a[n-x+1]-1"d;"NR"d"
	system("sed \''" cmd "\'' /dev/text >/tmp/a; mv /tmp/a /dev/text")
}' /dev/text