Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@grappler
Created October 12, 2013 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grappler/6954035 to your computer and use it in GitHub Desktop.
Save grappler/6954035 to your computer and use it in GitHub Desktop.
Bash file to create .mo files without keeping the .po files.
#! /bin/sh
for file in `/usr/bin/find . -name '*.po'` ; do /usr/bin/msgfmt -o ${file/.po/.mo} $file && /usr/bin/rm $file ; done
@fxbenard
Copy link

Nope it's not working for me, is it for you? It erases the content of the po not the file :)

@fxbenard
Copy link

! /bin/sh

for file in find . -name "*.po" ; do msgfmt -o ${file/.po/.mo} $file && rm $file ; done

is working beautifully, thanks man

@grappler
Copy link
Author

Great, I did not have time to test the first solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment