From: Hugo Villeneuve Date: Thu, 30 Nov 2023 23:28:25 +0000 (-0500) Subject: Parse line instead of file in get_pos() X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=98f01e0342af4a4ef4f026552d793c96e4976b86;p=fgen.git Parse line instead of file in get_pos() --- diff --git a/fgen.sh b/fgen.sh index c4c6fe9..62c636d 100755 --- a/fgen.sh +++ b/fgen.sh @@ -65,10 +65,12 @@ function get_size() cat ${layers} | grep -m 1 "${1}" | ${SED} "s/.*geometry:\([0-9]\+x[0-9]\+\).*/\1/g" } -# Arg1: layer +# Arg1: line function get_pos() { - cat ${layers} | grep "${1}" | ${SED} "s/.*geometry:[0-9]\+x[0-9]\+\([+-][0-9]\+[+-][0-9]\+\),.*/\1/g" + local token + token=$(echo "${1}" | ${SED} "s/.*geometry:[0-9]\+x[0-9]\+\([+-][0-9]\+[+-][0-9]\+\),.*/\1/g") + echo "${token}" } # Arg1: line