projects
/
fgen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5d4c7f3
)
Parse line instead of file in get_pos()
author
Hugo Villeneuve
<hugo@hugovil.com>
Thu, 30 Nov 2023 23:28:25 +0000
(18:28 -0500)
committer
Hugo Villeneuve
<hugo@hugovil.com>
Thu, 30 Nov 2023 23:29:57 +0000
(18:29 -0500)
fgen.sh
patch
|
blob
|
history
diff --git
a/fgen.sh
b/fgen.sh
index
c4c6fe9
..
62c636d
100755
(executable)
--- 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: l
ayer
+# Arg1: l
ine
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