OSX: Execute same command on all files within a folder -


i using command-line tool called tmx (https://github.com/tonybeltramelli/tmxresolutiontool) want execute command on every .png file in folder. how can that?

this how used:

tmxresolutiontool <tmx path> <resize ratio> tmxresolutiontool <image path> <resize ratio> tmxresolutiontool <image path> <new width> <new height> 

cheers.

find <path> -name "*.png" | xargs -irepl tmxresolutiontool repl <ratio> 

if need run commands in order on each file before moving next, small bash script may clearer

find <path> -name "*.png" | while read f ;  tmxresolutiontool $f <resize ratio> ;  tmxresolutiontool $f <resize ratio> ; tmxresolutiontool $f <new width> <new height> ; done 

Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -