diff options
author | Thomas Voss <mail@thomasvoss.com> | 2023-11-18 23:48:54 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2023-11-18 23:48:54 +0100 |
commit | 8ed42c04a81582a61b97a3304655cc5023f635f1 (patch) | |
tree | 2e0b9a8b25344720f66b0f8b15a035592d7c1d4c /.local/bin/uni | |
parent | bedf1d32932bd6753d3e443e9eae5ddd89b9f9a5 (diff) |
uni: Sed -e considered harmful
Diffstat (limited to '.local/bin/uni')
-rwxr-xr-x | .local/bin/uni | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/.local/bin/uni b/.local/bin/uni index 73c6e1c..9a8d636 100755 --- a/.local/bin/uni +++ b/.local/bin/uni @@ -8,13 +8,14 @@ export NOTIFY_SHORT="${0##*/}" setup() { curl 'https://www.unicode.org/Public/UNIDATA/UnicodeData.txt' \ - | >"$DATA" sed -E \ - -e 's/;[^;]*//2g' \ - -e 's/\<(.)([A-Z]*)/\1\L\2/2g' \ - -e '/^[^;]*;</d' \ - -e '/Compatibility/d' \ - -e '/Variation Selector/d' \ - -e 's/[^;]*/\\\\u&/' + | sed -E ' + s/;[^;]*//2g + s/\<(.)([A-Z]*)/\1\L\2/2g + /^[^;]*;</d + /Compatibility/d + /Variation Selector/d + s/[^;]*/\\\\u&/ + ' >"$DATA" } readonly DATA="${XDG_DATA_HOME:-$HOME/.local/share}/unicode-data" |