summaryrefslogtreecommitdiff
path: root/bin/hlp/absln
blob: be195a9b550cc130adb4d36fc928de0f8491aaaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

# absln -- convert to absolute line

test $# -ne 1 && { echo "usage: $0 line" 1>&2; exit 1; }
case "$1" in
'+'*)
	test -z "${1#+}" && term=1 || term=${1#+}
	expr `cat $EFP/line` + $term ;;
'-'*)
	test -z "${1#-}" && term=1 || term=${1#-}
	expr `cat $EFP/line` - $term ;;
.)
	cat $EFP/line ;;
*)
	echo "$1" ;;
esac