从
KS=$(locate acpi-support | grep "/etc/rc" | cut -f4 -d/ | tr -dc '[K,S]')
LEVELS=$(locate acpi-support | grep "/etc/rc" | cut -f3 -d/ | tr -dc '[0-9]')
echo $KS
echo $LEVELS
我得到以下输出:
KSSSS
12345
我想做的是以这种方式交替合并以前的输出:
K1 S2 S3 S4 S5
我尝试了嵌套for循环,但没有成功,我该怎么做?