Skip to content

Instantly share code, notes, and snippets.

@vinnybad
Created October 1, 2015 15:51
Show Gist options
  • Save vinnybad/5124e6567161ca8eb4bd to your computer and use it in GitHub Desktop.
Save vinnybad/5124e6567161ca8eb4bd to your computer and use it in GitHub Desktop.
Finding all files of a particular type (e.g. all .strings files for iOS internalization) and adding them to a zip
#!/bin/bash
find . -name '*.strings' -print | egrep -v 'Pods' | zip source -@
# Break it down:
#
# Find all files with file name ending with .strings
# find . -name '*.strings' -print
#
# Search for all lines that don't have 'Pods' in it (the -v means invert)
# egrep -v 'Pods'
#
#
# Zip up all files with whatever is specified via standard input
# zip source -@
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment