LoginSignup
1
1

More than 5 years have passed since last update.

bash > Brace Expansion > 複数の拡張子 > echo {X..Z}.{jpg,png,bin} | file.txtをfile.txt.bakにコピーするBrace Expansion

Last updated at Posted at 2017-10-17
動作環境
Windows 7 Pro (32bit)
SmartGit Version 17.0.4 #10132
SmartGit付属のMinGW32
grep (GNU grep) 2.24
head (GNU coreutils) 8.25

複数の拡張子のファイル名をBrace Expansionで取得する方法が気になった。

参考: https://unix.stackexchange.com/questions/196359/using-for-file-in-to-select-multiple-extension-names-then-get-the-basename-of

asked Apr 15 '15 at 10:08
The Wolf

以下で良さそう。

$ echo {X..Z}.{jpg,png,bin}
X.jpg X.png X.bin Y.jpg Y.png Y.bin Z.jpg Z.png Z.bin

余談

file.txtをfile.txt.bakにコピーするBrace Expansionが見つかったが、今のところ使う予定はない。

関連

bash > Brace Expansionで日付のダミーファイルを作る | ファイル名失敗時: MinGW32でファイルを消す

関連

PowerShellのBrace Expansionの記事はこちら

情報感謝です

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