dotfiles/.vim/bash-support/codesnippets/read-and-split-into-array

10 lines
330 B
Plaintext
Raw Normal View History

2019-10-20 16:24:07 -05:00
declare infilename="" # input filename
declare -a part # make part an array
IFS=':' # set input field separator
while read -a part ; do # read and split into fields
# use ${part[i]}
done < "$infilename"