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