]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Use a temporary file for sed_in_place()
authorRamiro Polla <ramiro.polla@gmail.com>
Thu, 15 Jul 2010 18:49:44 +0000 (15:49 -0300)
committerJoel Rosdahl <joel@rosdahl.net>
Fri, 16 Jul 2010 14:22:01 +0000 (16:22 +0200)
test.sh

diff --git a/test.sh b/test.sh
index 305174b14c2cc483f28ec6c8f0831205c1035dad..ace9efa80a664e82505fb3629982d6de96230198 100755 (executable)
--- a/test.sh
+++ b/test.sh
@@ -103,7 +103,8 @@ sed_in_place() {
     expr=$1
     shift
     for file in $*; do
-        (rm $file; sed "$expr" >$file) <$file
+        sed "$expr" > ${file}.sed < $file
+        mv ${file}.sed $file
     done
 }