summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2015-06-03 08:13:29 +0200
committerDirk Engling <erdgeist@erdgeist.org>2015-06-03 08:13:29 +0200
commit337084cd6c31450761c784a7fa723875ce2e358f (patch)
treea591970e5d06906cf0f30ef4e8b102eb9e93429b
parentb8bb694ab72177dd56ee1bed62933f62167a421c (diff)
make our invocation of sed GNU and BSD proof
-rwxr-xr-xmakecolumns.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/makecolumns.sh b/makecolumns.sh
index 0eaf954..8df1c25 100755
--- a/makecolumns.sh
+++ b/makecolumns.sh
@@ -241,7 +241,8 @@ handle_format_version_3() {
241 [ -f 15_unknown ] && mv 15_unknown 15_Webadresse 241 [ -f 15_unknown ] && mv 15_unknown 15_Webadresse
242 242
243 printf "Normalizing flags ... " 243 printf "Normalizing flags ... "
244 sed -i '' -e s:^1$:00:g -e s:^3$:01:g -e s:^2$:02:g 01_Flags 244 sed -i.bak -e s:^1$:00:g -e s:^3$:01:g -e s:^2$:02:g 01_Flags
245 rm 01_Flags.bak
245 printf "done.\n" 246 printf "done.\n"
246 247
247 printf "Normalizing zusaetze ... " 248 printf "Normalizing zusaetze ... "
@@ -369,7 +370,8 @@ tidy_streetnames () {
369 370
370 # Replace any dots at end of line by a single one 371 # Replace any dots at end of line by a single one
371 # finish any str abbreviation without a period with a period 372 # finish any str abbreviation without a period with a period
372 sed -Ei '' 's/\.+/./g;s/(S|s)tr( |:)?$/\1tr./' ${streets} 373 sed -E -i.bak 's/\.+/./g;s/(S|s)tr( |:)?$/\1tr./' ${streets}
374 rm "${streets}".bak
373} 375}
374 376
375# After function definitions, main() can use them 377# After function definitions, main() can use them