From 914a3d9eb768bce9a978d6e9a7f833288c3dea0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Wed, 6 Jan 2021 21:25:11 +0100 Subject: Add `r' (line range) selector, `absln' (absolute line) helper --- bin/slt/r | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 bin/slt/r (limited to 'bin/slt') diff --git a/bin/slt/r b/bin/slt/r new file mode 100755 index 0000000..5d2c184 --- /dev/null +++ b/bin/slt/r @@ -0,0 +1,10 @@ +#!/bin/sh + +# r -- select line range + +test $# -ne 2 && { echo "usage: $0 start end" 1>&2; exit 1; } + +start=`absln $1` +end=`absln $2` + +sed -n "$start,${end}p" -- cgit v1.2.3