-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: invalid integer contant at line 445 #11
Comments
Hey, I also wanted to test this and ran against this issue. It looks like there are a couple issues, one is that sometimes the row consists of Once we get past that, the regex is not prepared to handle Here is a quick patch I prepared to play with things :-) diff --git a/aic.sh b/aic.sh
index 755d7bd..424b546 100755
--- a/aic.sh
+++ b/aic.sh
@@ -390,11 +390,16 @@ if [ ! "$OPT_FILL" = '--fill' ]; then
for ROW in "${ROWS[@]}"; do
# Transform spans into space-separated quadruples of R G B [Char], using pipes as span-separators
- ROW="$(echo "$ROW" | sed -E "s/<span style='color:#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2});'>(.)<\/span>/\1 \2 \3 \4|/g")"
+ ROW="$(echo "$ROW" | sed -E -e "s/ / /g" -e "s/<span style='color:#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2});'>(.)<\/span>/\1 \2 \3 \4|/g")"
# Discard the last pipe
ROW="${ROW::-1}"
+ if [ "$ROW" = "<pre" ]; then
+ continue;
+ fi
+
+
# Split row into columns using pipes
while IFS='|' read -ra COLS; do
for COL in "${COLS[@]}"; do
@@ -429,11 +434,15 @@ else
for ROW in "${ROWS[@]}"; do
# Transform spans into space-separated quadruples of R G B [Char], using pipes as span-separators
- ROW="$(echo "$ROW" | sed -E "s/<span style='color:#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2}); background-color:#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2});'>(.)<\/span>/\1 \2 \3 \4 \5 \6 \7|/g")"
+ ROW="$(echo "$ROW" | sed -E -e "s/ / /g" -e "s/<span style='color:#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2}); background-color:#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2});'>(.)<\/span>/\1 \2 \3 \4 \5 \6 \7|/g")"
# Discard the last pipe
ROW="${ROW::-1}"
+ if [ "$ROW" = "<pre" ]; then
+ continue;
+ fi
+
# Split row into columns using pipes
while IFS='|' read -ra COLS; do
for COL in "${COLS[@]}"; do |
I just downloaded that wonderful bash-script for this wonderful idea.
I am running Debian 12, installed jq and jq2a additionally.
but when I try to start the script without any parameter (so, a random oil painting should be shown), I receive the following:
$./aic.sh
./aic.sh: line 445: 16#: invalid integer constant (error token is "16#")
Bacchic Revels, c. 1740
Johann Georg Platzer (Austrian, 1704–1761)
https://www.artic.edu/artworks/46383/bacchic-revels
this happens also a second time:
$./aic.sh
./aic.sh: line 445: 16#: invalid integer constant (error token is "16#")
Queen Philippa at the Battle of Neville's Cross, c. 1789
Benjamin West (British, born United States, 1738–1820)
https://www.artic.edu/artworks/57652/queen-philippa-at-the-battle-of-neville-s-cross
The text was updated successfully, but these errors were encountered: