LoginSignup
0
0

More than 5 years have passed since last update.

bash で配列を使うサンプル

Posted at

bash で配列を使うサンプルです
xlsx を json に変換するスクリプトの一部です。

#
pref=(toyama ishikawa shizuoka aichi mie gifu)
jpn=(富山 石川 静岡 愛知 三重 岐阜)
echo ${pref[0]},${jpn[0]}
echo ${pref[1]},${jpn[1]}
#
it=0
for pp in "${pref[@]}"
do
    qq=${jpn[$it]}
    file_xlsx=`ls コード内容別一覧表(医科)$qq*.xlsx`
    echo $file_xlsx
    file_json=$pp"/"$pp"_ika.json"
    echo $file_json
    echo $it,$pp,$qq    
    let it=it+1
done
#
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0