sed  doesn't edit in situ.

Try

$ cat add_dot.txt
sex.com
blahblah.com
weak.com

sed 's/^/./gw u.out'  add_dot.txt | mv u.out add_dot.txt

$ cat add_dot.txt
.sex.com
.blahblah.com
.weak.com



On Wed, Jul 15, 2009 at 10:28 AM, Kelsey Hartigan Go <
[email protected]> wrote:

> You can use ex, or even vi
> %s/^/\./g
> :wq
>
>
> On 7/15/09, eric pareja <[email protected]> wrote:
> > hi david,
> >
> > the more "traditional" way would have been to use sed as follows:
> >
> > sed -i.bak s/^/./g porndomain.cal
> >
> > side-effect is to generate a backup file with the .bak extension.
> >
> > xen
> >
> > On Wed, Jul 15, 2009 at 12:14 PM, david t. asuncion,
> > jr.<[email protected]> wrote:
> >> A total CLI newbie here. :)
> >>
> >> I have a file like this...
> >>
> >> cat porndomain.acl
> >>
> >> sex.com
> >> blahblah.com
> >> weak.com
> >> ....
> >>
> >> What I want to happen is to add a "." on each line to look like this...
> >>
> >> .sex.com
> >> .blahblah.com
> >> .weak.com
> >>
> >> How can I do that with one line of command in Linux?
> >>
> >> --
> >> David Tacasa Asuncion, Jr.
> >> website keeper, forever linux newbie, BUM extraordinaire
> >>
> >> Linux User # 406430
> >> http://counter.li.org/
> >>
> >> GPG: 0A024BC0
> >>
> >>
> >>
> >> _________________________________________________
> >> Philippine Linux Users' Group (PLUG) Mailing List
> >> http://lists.linux.org.ph/mailman/listinfo/plug
> >> Searchable Archives: http://archives.free.net.ph
> >>
> >
> >
> >
> > --
> > eric pareja ([email protected]) LPIC-2 | PGP/GPG Key 0xB82E42D9
> > Coordinator for Technology / Senior Linux Trainer
> > National Telehealth Center, University of the Philippines Manila
> > International Open Source Network - ASEAN+3
> > "Ang mundo ay aklat, at iisang pahina lamang ang nababasa ng hindi
> > naglalakbay."
> >  わかよたれぞ つねならむ
> > _________________________________________________
> > Philippine Linux Users' Group (PLUG) Mailing List
> > http://lists.linux.org.ph/mailman/listinfo/plug
> > Searchable Archives: http://archives.free.net.ph
>
> --
> Sent from my mobile device
>
> Kelsey Hartigan Go
> Registered Linux user #5998
> _________________________________________________
> Philippine Linux Users' Group (PLUG) Mailing List
> http://lists.linux.org.ph/mailman/listinfo/plug
> Searchable Archives: http://archives.free.net.ph
_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
http://lists.linux.org.ph/mailman/listinfo/plug
Searchable Archives: http://archives.free.net.ph

Reply via email to