remove_string.sh 363 B

1234567891011121314
  1. #!/bin/bash
  2. #
  3. # Copyright (C) 2013 Reece H. Dunn
  4. # License: GPLv3+
  5. #
  6. # Helper utility for removing a string/string-list item in all string resources.
  7. #
  8. # Usage: ./remove_string.sh <string_id>
  9. ls res/values*/strings.xml | while read STRINGS ; do
  10. xmlstarlet ed -P -d "/resources/*[@name='${1}']" ${STRINGS} > /tmp/strings.xml
  11. mv /tmp/strings.xml ${STRINGS}
  12. done