我試圖運行ImageMagick的識別圖像的一個非常大的路徑上的命令,其中確定返回與模式匹配的文件的圖像尺寸範圍內。我想匹配的模式爲:正則表達式語法ImageMagick的「標識」的bash shell
/jewelclub_[a-z0-9]{1,}_(small|medium|large|zoom)\.jpg/
當我嘗試執行以下兩個命令,第一個成功和失敗,第二它好像有一定是壞了我的正則表達式:
(1): identify -format "%f %w %h %b \n" 'jewelclub_*\.jpg'
(2): identify -format "%f %w %h %b \n" 'jewelclub_[a-z0-9]{1,}_(small|medium|large|zoom)\.jpg'
有關如何將命令#2中的PCRE語法更改爲兼容的RegEx風格(BRE?ERE?)的任何建議?
在此先感謝您的幫助。
'find -E' - 哪個版本的find是?爲什麼不使用-exec,而是xargs? –
@userunknown你說得對,我應該使用'-exec'來代替管道到'xargs'。至於'find',這是Macbook(BSD衍生)的[什麼發貨](http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/find.1.html) 。 – wehal3001
訣竅。謝謝! – jonaz