Replace non-portable sed code with some simple awk
authorSteve McIntyre <steve@einval.com>
Mon, 6 Aug 2018 22:42:09 +0000 (23:42 +0100)
committerSteve McIntyre <steve@einval.com>
Mon, 6 Aug 2018 22:42:09 +0000 (23:42 +0100)
Should now work on FreeBSD again.

abcde
changelog

diff --git a/abcde b/abcde
index 66be0fa..ae7bb79 100755 (executable)
--- a/abcde
+++ b/abcde
@@ -2110,7 +2110,7 @@ do_discid ()
                                CDPARANOIAAUDIOTRACKS="$TRACKS"
 
                                LEADOUT="$(echo "$CDPARANOIAOUTPUT" | grep -Eo '^TOTAL[[:space:]]+([[:digit:]]+)' | get_last)"
-                               OFFSETS="$(echo "$CDPARANOIAOUTPUT" | sed -n -e's/^ .* \([0-9]\+\) \[.*/\1/p')"
+                               OFFSETS="$(echo "$CDPARANOIAOUTPUT" | awk '/^ +.*\[/ {print $4}')"
                                makeids
                                ;;
                        *)
index 4e3120b..3e28628 100644 (file)
--- a/changelog
+++ b/changelog
@@ -1,5 +1,8 @@
 abcde 2.9.3-DEV
 
+ * Replace non-portable sed code for generating offset list with some
+   simple awk instead. Should now work on FreeBSD again.
+
 abcde 2.9.2
 
  * Fix up lookup code to deal with spaces etc. in directory names