LoginSignup
0
0

More than 3 years have passed since last update.

bash の for で year / month /day を回すとか

Posted at
set -exou pipefail


y_str=2020
for m in {1..2} ; do
    echo ${m}
    for d in {1..31} ; do
        m_str=`printf %02d $m`
        d_str=`printf %02d $d`
        echo ${m_str}-${d_str}
    done
done

for m in {1..2} ; do
    echo ${m}
    for d in {1..31} ; do
        m_str=`printf %02d $m`
        d_str=`printf %02d $d`
        echo ${m_str}-${d_str}
        echo "aws s3 ls 's3://EXAMPLE.COM/LLLLL/YYYY=${y_str}/MM=${m_str}/DD=${d_str}/'";
    done
done
0
0
1

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