Skip to content

Instantly share code, notes, and snippets.

@Girgias
Last active November 3, 2020 08:32
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 Girgias/440124551e14c3bc5106c53bc493449e to your computer and use it in GitHub Desktop.
Save Girgias/440124551e14c3bc5106c53bc493449e to your computer and use it in GitHub Desktop.
Commands to update French docs canonical type and sync with EN revision

Changes to be made:

  • <type>integer</type> into <type>int</type>
  • <type>boolean</type> into <type>bool</type>
  • <type>entier</type> into &integer;

Example for <type>integer</type>:

Find and update the SVN Revision first:

grep -rl --exclude-dir=.svn '<type>integer</type>' ./ | xargs sed -i 's/<!-- EN-Revision:[[:blank:]][[:blank:]]*[[:digit:]][[:digit:]]*[[:blank:]][[:blank:]]*Maintainer:/<!-- EN-Revision: 351133 Maintainer:/'

Search and replace:

grep -rl --exclude-dir=.svn '<type>integer</type>' ./ | xargs sed -i 's#<type>integer</type>#<type>int</type>#g'

Full list of command executed:

grep -rl --exclude-dir=.svn '<type>integer</type>' ./ | xargs sed -i 's/<!-- EN-Revision:[[:blank:]][[:blank:]]*[[:digit:]][[:digit:]]*[[:blank:]][[:blank:]]*Maintainer:/<!-- EN-Revision: 351133 Maintainer:/'
grep -rl --exclude-dir=.svn '<type>integer</type>' ./ | xargs sed -i 's#<type>integer</type>#<type>int</type>#g'
grep -rl --exclude-dir=.svn '<type>boolean</type>' ./ | xargs sed -i 's/<!-- EN-Revision:[[:blank:]][[:blank:]]*[[:digit:]][[:digit:]]*[[:blank:]][[:blank:]]*Maintainer:/<!-- EN-Revision: 351133 Maintainer:/'
grep -rl --exclude-dir=.svn '<type>boolean</type>' ./ | xargs sed -i 's#<type>boolean</type>#<type>bool</type>#g'
grep -rl --exclude-dir=.svn '<type>entier</type>' ./ | xargs sed -i 's/<!-- EN-Revision:[[:blank:]][[:blank:]]*[[:digit:]][[:digit:]]*[[:blank:]][[:blank:]]*Maintainer:/<!-- EN-Revision: 351133 Maintainer:/'
grep -rl --exclude-dir=.svn '<type>entier</type>' ./ | xargs sed -i 's#<type>entier</type>#\&integer;#g'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment