Fix split_by_char
This commit is contained in:
parent
c1939f45d3
commit
5e3fc5d799
14
dotfiles/lib/functions/split_by_char
Executable file
14
dotfiles/lib/functions/split_by_char
Executable 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 "$@"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user