Fix split_by_char

This commit is contained in:
Ivan Malison 2021-08-02 06:32:57 -06:00
parent c1939f45d3
commit 5e3fc5d799
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8

View File

@ -0,0 +1,14 @@
#!/usr/bin/env sh
function split_by_char {
flags="-ra"
environment_variable_exists ZSH_VERSION && flags="-A"
IFS="$1" read $flags ADDR <<< "$2"
for i in ${ADDR[@]}; do
echo "$i"
done
}
split_by_char "$@"