tags 20572 notabug close 20572 thanks Thanks for confirming that the problem was not with GNU sed. On Thu, May 14, 2015 at 6:55 PM Lu Qin wrote: > > Thank you for you replay. > > I google the problem and I found that It is because I use mac and the sed > version is not same as the GNU sed . > > > > 在 2015年5月15日,06:39,Norihiro Tanaka 写道: > > > > > > On Thu, 14 May 2015 17:00:58 +0800 > > Lu Qin wrote: > > > >> when I use sed like this : > >> > >> sed -i -e 's/\(public class TInfo .*\)$/\1\ > >> \ > >> private static final long serialVersionUID = -4659975753252858243l; > \/\/ See ACCUMULO-3132\ > >> /' src/main/java/org/apache/accumulo/trace/thrift/TInfo.java > >> > >> It will create a file name TInfo.java-e as a backup,but the -e is not > the backup extension I use. > >> > >> > >> If I use it like this: > >> sed -i '' -e 's/\(public class TInfo .*\)$/\1\ > >> \ > >> private static final long serialVersionUID = -4659975753252858243l; > \/\/ See ACCUMULO-3132\ > >> /' src/main/java/org/apache/accumulo/trace/thrift/TInfo.java > >> > >> It will be work ok and not create a backup file what I want. > > > > $ tar xzf accumulo-1.6.2-src.tar.gz > > $ cd accumulo-1.6.2/trace > > > > $ sed --version > > sed (GNU sed) 4.2.2 > > Copyright (C) 2012 Free Software Foundation, Inc. > > License GPLv3+: GNU GPL version 3 or later < > http://gnu.org/licenses/gpl.html>. > > This is free software: you are free to change and redistribute it. > > There is NO WARRANTY, to the extent permitted by law. > > > > Written by Jay Fenlason, Tom Lord, Ken Pizzini, > > and Paolo Bonzini. > > GNU sed home page: . > > General help using GNU software: . > > E-mail bug reports to: . > > Be sure to include the word ``sed'' somewhere in the ``Subject:'' field. > > > > $ sed -i -e 's/\(public class TInfo .*\)$/\1\ > > \ > > private static final long serialVersionUID = -4659975753252858243l; > \/\/ See ACCUMULO-3132\ > > /' src/main/java/org/apache/accumulo/trace/thrift/TInfo.java > > > > $ ls src/main/java/org/apache/accumulo/trace/thrift/TInfo.java* > > src/main/java/org/apache/accumulo/trace/thrift/TInfo.java > > > > $ sed -i '' -e 's/\(public class TInfo .*\)$/\1\ > > \ > > private static final long serialVersionUID = -4659975753252858243l; > \/\/ See ACCUMULO-3132\ > > /' src/main/java/org/apache/accumulo/trace/thrift/TInfo.java > > sed: can't read : No such file or directory > > > > $ ls src/main/java/org/apache/accumulo/trace/thrift/TInfo.java* > > src/main/java/org/apache/accumulo/trace/thrift/TInfo.java > > > > > > I see that it is not a bug. > > > > > > > > > >