Wednesday, August 25, 2010

grep Regular Expressions and Internationalization

Wanted to find all meaningful text strings in an iPhone project, preparing for a proper internationalization:
grep -r '@"' * |grep -v -E 'NSAssert|NSLog|@""'
Forgotten this so many times, it's better to write it down: how to search for several patterns at the same time using grep on Mac OS X command line (bash shell). Could use also command line parameter -P (Perl Regular Expression) in this case, but -E (Extended Regular Expression) is more generic. why wasn't internationalization done in the first place, when things were still simple? Because in certain kind of experimental projects you need to get results fast and early to decide whether it's worth continuing at all. If available time is used for "doing things right", there won't be any (good enough) results and The Project Will Be Terminated.

Just a question when do you want to invest your time: early or later. Have to pay the price anyway. Usually the longer you wait, the higher the price will be. On the other hand at that time you might have afford it.

No comments:

Post a Comment