LoginSignup
1
1

More than 3 years have passed since last update.

bash で繰り返し特定コマンドを実行させる

Posted at

例: 大量のディレクトリ毎に個別に tar.gz に圧縮する

#!/bin/sh

# ディレクトリ名のリスト
array=(
"0000"
"0001"
"0002"
)

for i in ${array[@]}; do
    echo "start tar ${i}"
    tar -zcf ${i}.tgz ${i}
done
1
1
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
1
1