summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Wassberg <jocar@sunet.se>2022-11-01 11:45:29 +0100
committerJohan Wassberg <jocar@sunet.se>2022-11-01 11:45:29 +0100
commit85c2bacaeed7dce1b24742c26cf475da958120c8 (patch)
tree98cf1eb2f3221a3bd64ef7e3953b7680b1c66d23
parenta1372213059f34807165859fe8b9195097b84e01 (diff)
Portability
-rwxr-xr-xscripts/rename-xml.sh12
1 files changed, 5 insertions, 7 deletions
diff --git a/scripts/rename-xml.sh b/scripts/rename-xml.sh
index e82742d9..59a0f04b 100755
--- a/scripts/rename-xml.sh
+++ b/scripts/rename-xml.sh
@@ -18,12 +18,6 @@ EOF
exit 1
fi
-if [ `uname -s` == "Darwin" ]; then
- SEDI="sed -i ''"
-else
- SEDI="sed -i"
-fi
-
script_cwd=`dirname "$0"`
if test -d swamid-2.0 ; then
echo "Moving into swamid-2.0/"
@@ -56,7 +50,11 @@ read x
case $x in
Y|y|"")
grep -l "$metadata\"" ../*.mxml | while read file; do
- $SEDI "s;href=\"swamid-2.0/$metadata\";href=\"swamid-2.0/$entityidfn\";" $file
+ sed -i.bak "s;href=\"swamid-2.0/$metadata\";href=\"swamid-2.0/$entityidfn\";" $file
+ if [ -f ${file}.bak ]; then
+ rm ${file}.bak
+ fi
+
done
git mv $metadata $entityidfn