File: remove_string.sh

package info (click to toggle)
espeak-ng 1.50%2Bdfsg-7%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 60,252 kB
  • sloc: ansic: 44,529; java: 4,005; xml: 1,605; makefile: 1,055; python: 1,020; sh: 573; javascript: 383; cpp: 300
file content (13 lines) | stat: -rwxr-xr-x 363 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash
#
# Copyright (C) 2013 Reece H. Dunn
# License: GPLv3+
#
# Helper utility for removing a string/string-list item in all string resources.
#
# Usage: ./remove_string.sh <string_id>

ls res/values*/strings.xml | while read STRINGS ; do
	xmlstarlet ed -P -d "/resources/*[@name='${1}']" ${STRINGS} > /tmp/strings.xml
	mv /tmp/strings.xml ${STRINGS}
done