From a8c2415961ae8b952a4fc57f19435c1d5ef883dd Mon Sep 17 00:00:00 2001 From: "John Ankarstr\\xf6m" Date: Mon, 31 May 2021 19:39:42 +0200 Subject: Add 'inc' utility --- Makefile | 7 ++----- inc | 3 +++ 2 files changed, 5 insertions(+), 5 deletions(-) create mode 100755 inc diff --git a/Makefile b/Makefile index a9e2042..da662ea 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,3 @@ -install: bin man - -man: +install: install -m 644 *.1 /usr/local/man/man1/ -bin: - ls * | grep -v '\.1$$' | xargs -I{} install {} /usr/local/bin/ + install `ls -l | awk '$$1 ~ /x$$/ {print $$NF}'` /usr/local/bin diff --git a/inc b/inc new file mode 100755 index 0000000..51345a5 --- /dev/null +++ b/inc @@ -0,0 +1,3 @@ +#!/usr/bin/perl -p +# inc -- increment numbers in lines +s/\d+/$n=$& if!$n;$n+$i++/e -- cgit v1.2.3