summaryrefslogtreecommitdiff
path: root/nocompile/bin/XuntilY.awk
diff options
context:
space:
mode:
authorEpoch Qwert <epoch@53flpnlls43fcguy.onion>2015-01-09 19:25:02 -0600
committerEpoch Qwert <epoch@53flpnlls43fcguy.onion>2015-01-09 19:25:02 -0600
commit3f6b64304a8a11f0505e91681384327696983928 (patch)
tree77cffccf8ad8901b844334a0c068ac951e93d6a8 /nocompile/bin/XuntilY.awk
parente23c6287bb1124397c126c83cc73fed17fda998f (diff)
downloadmisc-3f6b64304a8a11f0505e91681384327696983928.tar.gz
misc-3f6b64304a8a11f0505e91681384327696983928.zip
XuntilY.awk is actually a shell script, but mostly written in awk to make XuntilY easier to use for people without Perl
gopherd.sh... I don't remember the change. music.c is to practice reading music. sockip is to get the IP of the listening socket, like if ran from inetd
Diffstat (limited to 'nocompile/bin/XuntilY.awk')
-rwxr-xr-xnocompile/bin/XuntilY.awk16
1 files changed, 16 insertions, 0 deletions
diff --git a/nocompile/bin/XuntilY.awk b/nocompile/bin/XuntilY.awk
new file mode 100755
index 0000000..6334d31
--- /dev/null
+++ b/nocompile/bin/XuntilY.awk
@@ -0,0 +1,16 @@
+#!/bin/sh
+if [ "_$3" = "_" ];then
+ count=1
+else
+ count="$3"
+fi
+awk '
+BEGIN {counter='$count'}
+/'$1'/, /'$2'/{
+ print $0;
+ if($0 ~ /'$2'/) {
+ counter--;
+ }
+ if(counter == 0) {nextfile}
+}
+'