bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sed --in-place bug (updates mtime of file even if no changes are made)


From: John Vanderpool
Subject: sed --in-place bug (updates mtime of file even if no changes are made)
Date: Tue, 8 Nov 2011 16:32:27 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110921 Thunderbird/3.1.15

--in-place shouldn't update the mtime of the file if the pattern doesn't match
(i.e. no changes were made to file) - sed is great - thanx for your support!

$ sed --version    # on ubuntu (same problem with sed version 4.1.5 on redhat 
5.7)
GNU sed version 4.2.1

$ date
Tue Nov  8 16:12:59 EST 2011

$ touch a b
$ ls -l
-rw-r--r-- 1 fish fish    0 Nov  8 16:12 a
-rw-r--r-- 1 fish fish    0 Nov  8 16:12 b

$ date
Tue Nov  8 16:13:14 EST 2011

$ sed --in-place 's%foo%bar%g'  a b

$ ls -l
-rw-r--r-- 1 fish fish    0 Nov  8 16:13 a
-rw-r--r-- 1 fish fish    0 Nov  8 16:13 b




reply via email to

[Prev in Thread] Current Thread [Next in Thread]