bug-sed
[Top][All Lists]
Advanced

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

bug#20572: bug about sed when use -i


From: Jim Meyering
Subject: bug#20572: bug about sed when use -i
Date: Sun, 17 May 2015 02:17:24 +0000

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 <address@hidden> 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 <address@hidden> 写道:
>
>
> On Thu, 14 May 2015 17:00:58 +0800
> Lu Qin <address@hidden> 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: <address@hidden>.
> 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.
>
>






reply via email to

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