I'm using sh (not bash/csh) on FreeBSD 11, and I don't understand this:
zpool status -v
pool: My_pool state: ONLINE status: One or more devices is currently being resilvered. The pool will continue to function, possibly in a degraded state. action: Wait for the resilver to complete.
Splitting by lines and printing line at a time in a script:
#!/bin/sh zp="$(zpool status -v)" for line in $zp; do echo "$line%" done
pool:% My_pool% state:% ONLINE% status:% One% or% more% devices% is% currently% being% resilvered.% The% pool% will% continue% to% function,% possibly% in% a% degraded% state.% action:% Wait%
According to all I can find, the syntax I'm using is correct for sh, and should read a line at a time, not a word at a time.
What am I missing?