From baf1bafa5c90b856c690b33ff74bc0fec344ae1c Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 18 Feb 2013 00:41:36 +0100 Subject: examples/rifle_sxiv.sh: removed realpath dependency --- examples/rifle_sxiv.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/examples/rifle_sxiv.sh b/examples/rifle_sxiv.sh index 542aa604..0cbda01e 100755 --- a/examples/rifle_sxiv.sh +++ b/examples/rifle_sxiv.sh @@ -11,12 +11,19 @@ # [ "$1" == '--' ] && shift -target="$(realpath -s "$1")" + +function abspath { + case "$1" in + /*) printf "%s\n" "$1";; + *) printf "%s\n" "$PWD/$1";; + esac +} function listfiles { find -L "$(dirname "$target")" -maxdepth 1 -type f -iregex \ '.*\(jpe?g\|bmp\|png\|gif\)$' -print0 | sort -z } +target="$(abspath $1)" count="$(listfiles | grep -m 1 -Zznx "$target" | cut -d: -f1)" if [ -n "$count" ]; then -- cgit 1.4.1-2-gfad0 value='main'>main Soul of a tiny new machine. More thorough tests → More comprehensible and rewrite-friendly software → More resilient society.Kartik K. Agaram <vc@akkartik.com>
about summary refs log blame commit diff stats
path: root/new_lesson
blob: 3642b8233c22ca952693006ddd2ae4cd6f491aea (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12