From a40c67ed42dce9fe8618f06284b1de77f72ff4dd Mon Sep 17 00:00:00 2001 From: davidovski Date: Sat, 28 May 2022 18:24:58 +0100 Subject: added reverse lines to xilib --- src/xilib.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') diff --git a/src/xilib.sh b/src/xilib.sh index 56e2592..736ddb6 100644 --- a/src/xilib.sh +++ b/src/xilib.sh @@ -20,4 +20,15 @@ checkroot () { } } +# reverse the order of lines +# +reverse_lines () { + local result= + while IFS= read -r line; do + result="$line + $result" + done + echo "$result" +} + -- cgit v1.2.1