Quantcast
Channel: Bashタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 2832

bashで連番の変数を区切り文字付きで作成

$
0
0
$ X=`seq -s "|" 1 12` $ echo ${X} 1|2|3|4|5|6|7|8|9|10|11|12 wgrib2のmatchでワイルドカード的なことがやりたかったため。 $ X=":PRATE:surface:(`seq -s "|" 1 12`) hour fcst:" $ echo ${X} :PRATE:surface:(1|2|3|4|5|6|7|8|9|10|11|12) hour fcst: $ wgrib2 ~/Workspace/gfs-shell/data/atmos/gfs.t00z.pgrb2.0p25.f001 -match "${X}" 3:1392910:d=2021061600:PRATE:surface:1 hour fcst: $ wgrib2 ~/Workspace/gfs-shell/data/atmos/gfs.t00z.pgrb2.0p25.f006 -match "${X}" 3:1404951:d=2021061600:PRATE:surface:6 hour fcst: $ wgrib2 ~/Workspace/gfs-shell/data/atmos/gfs.t00z.pgrb2.0p25.f012 -match "${X}" 3:1407884:d=2021061600:PRATE:surface:12 hour fcst: $ wgrib2 ~/Workspace/gfs-shell/data/atmos/gfs.t00z.pgrb2.0p25.f018 -match "${X}"

Viewing all articles
Browse latest Browse all 2832

Latest Images

Trending Articles