Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要使用由另一个变量的名称组成的变量
#!/bin/bash -x i=0 cat << EOF | while read -r line a b c d EOF do ((i++)) ${z$i}=$line done
但不工作,我得到“坏替代”
那么,我该怎么做呢?
如果没有特别的理由坚持z1,z2等等。我建议改用数组。
z1
z2