This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: sed problem


> I'm using sed on cygwin.
>
> I have a problem with -i option.
>
> ----- ----- ----- ----- -----
> kei@cygwin% cat test
> apple
> kei@cygwin% ls
> test
> kei@cygwin% cat test
> apple
> kei@cygwin% sed -i "s/apple/orange/g" test
> kei@cygwin% cat test
> apple
> kei@cygwin% ls
> sed003980
> test
> kei@cygwin% cat sed003980
> orange
> kei@cygwin% ???
> ----- ----- ----- ----- -----
>
> I have no idea of what's happening.
> The version before this newest version seemed to work fine, but I
> forgot that version number...
>
> Does anybody have the same problem with me?
> And how can I fix this problem?
> Thank you in advance.
>
> [...]
> kei@cygwin% sed -V
> GNU sed version 4.0.1
> ----- ----- ----- ----- -----


Nope. The only difference in software is that I'm using version 4.0.5 .
Perhaps an upgrade would fix your problem. I haven't got the source for sed,
but it might be that it doesn't have write permission to file `test' to it
outputs to sed[pid] instead (silently?). Does the file `test' have write
permissions?

Here's what I tried

[elfyn@webdev]:{708}:% echo apple >test
[elfyn@webdev]:{709}:% cat test
apple
[elfyn@webdev]:{710}:% ls test
test
[elfyn@webdev]:{711}:% ls -al test
-rw-r--r--    1 elfyn    root            6 Feb 15 11:43 test
[elfyn@webdev]:{712}:% cat test
apple
[elfyn@webdev]:{713}:% sed -i 's/apple/orange/' test
[elfyn@webdev]:{714}:% cat test
orange
[elfyn@webdev]:{715}:%

All working, as it should :-)


Regards,

Elfyn McBratney
elfyn@exposure.org.uk
www.exposure.org.uk



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]