Closed brlin-tw closed 4 years ago
The snap struggles with UTF8 characters in general.
#!/bin/sh
curl -s "https://some.url/application?id=$1" | grep -F NAV | sed 's/>/\n/g' | grep -F GBX | cut -d'<' -f1 | sed 's/ /\n/' | tail -1 > $2.csv
$ shellcheck ~/test.sh
In /home/ken/test.sh line 3:
/home/ken/test.sh: <stdout>: commitBuffer: invalid argument (invalid character)
#!/bin/sh
[[ $ARTIST =~ 'a'|'e'|'i'|'A'|'E'|'I'|'O'|'S'|'U'|'Y' ]] && ARTIST=$(iconv -f UTF-8 -t ASCII//TRANSLIT <<<"$ARTIST")
$ shellcheck ~/test2.sh
In /home/ken/test2.sh line 3:
/home/ken/test2.sh: <stdout>: commitBuffer: invalid argument (invalid character)
shellcheck
itself works fine when installed via the repositories (Ubuntu is a few versions behind), and the online version works fine as expected.
This is related the use of snaps and could be a snaps bug. Unless there is a configuration option missing somewhere?
I've made up a patch to fix this, please review.
Take too long to come back to this :(
For bugs
shellcheck --version
or "online"):Here's a snippet or screenshot that shows the problem:
Here's what shellcheck currently says:
Here's what I wanted or expected to see:
snap information
Can be reproduced on edge and stable channel