更新时间:2023-12-02 19:11:22
array+=(item)
(not array+=item
).read
一样简单.作为奖励,最后一个变量获得第 N 个词和所有后续词.参见 help [r]ead
.array+=(item)
(not array+=item
).read
with multiple target variables. As a bonus, the last variable gets the Nth word and all subsequent words. See help [r]ead
.这节省了大量的叉子,但我还没有测试它有多快.
This saves a ton of forks, but I haven't tested how fast it is.
ogl_date=()
[...]
ogl_commands=()
while read -r date1 date2 time server id type pid commands
do
ogl_date+=("$date1 $date2")
[...]
ogl_commands+=("$commands")
done < /tmp/ftp_search.14-12-02