GNU bug report logs - #20572
bug about sed when use -i

Previous Next

Package: sed;

Reported by: Lu Qin <luq.java <at> gmail.com>

Date: Thu, 14 May 2015 09:17:03 UTC

Severity: normal

Tags: notabug

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lu Qin <luq.java <at> gmail.com>
To: Norihiro Tanaka <noritnk <at> kcn.ne.jp>
Cc: 20572 <at> debbugs.gnu.org
Subject: bug#20572: bug about sed when use -i
Date: Fri, 15 May 2015 09:54:13 +0800
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 <noritnk <at> kcn.ne.jp> 写道:
> 
> 
> On Thu, 14 May 2015 17:00:58 +0800
> Lu Qin <luq.java <at> gmail.com> 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: <http://www.gnu.org/software/sed/>.
> General help using GNU software: <http://www.gnu.org/gethelp/>.
> E-mail bug reports to: <bug-sed <at> gnu.org>.
> 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.
> 
> 





This bug report was last modified 8 years and 201 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.