Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.unix.shell > #1746

Re: sed question

From Janis Papanagnou <janis_papanagnou@hotmail.com>
Newsgroups comp.unix.shell
Subject Re: sed question
Date 2011-08-20 15:47 +0300
Organization Aioe.org NNTP Server
Message-ID <j2oadc$hc5$1@speranza.aioe.org> (permalink)
References (4 earlier) <6d7eb3a7-6d94-4fac-b3c2-e8bf48e16650@y39g2000prd.googlegroups.com> <slrnj4v19m.vuk.usenet-nospam@guild.seebs.net> <4df6eb0a-2173-43dd-a13a-a7bc285347ac@g8g2000prn.googlegroups.com> <j2o7jo$ahi$2@speranza.aioe.org> <84d851ad-df20-48e4-8882-276e58b3f6ef@g8g2000prn.googlegroups.com>

Show all headers | View raw


Am 20.08.2011 15:16, schrieb hsteenkamp@lycos.com:
> On Aug 20, 8:59 pm, Janis Papanagnou<janis_papanag...@hotmail.com>
> wrote:
>> Am 20.08.2011 14:51, schrieb hsteenk...@lycos.com:
>>
>>> [...]
>>
>>> OK, help me out. The general syntax is:
>>> $ sed 's/ [pattern] / [replace-string] / [flag]'  filename
>>
>>> So, it must be something like:
>>> $ sed 's/$/whatever/'  filename
>>
>> On my system the following does what you want...
>>
>> sed 's/.*/&\
>> &/'
>>
>> Janis
>
> Thx Janis. This works great on my system but each line is appended ...
> and not displayed twice.

This is why I said "on my system". Please make sure there's no blank
character behind the \ , then try the same on your system without the
final \ on the first line

sed 's/.*/&
&/'

Variants that may work on your system could also be one of

sed "s/.*/&$'\n'&/"
sed 's/.*/&\n&/'


Janis

Back to comp.unix.shell | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

sed question hsteenkamp@lycos.com - 2011-08-19 23:16 -0700
  Re: sed question Seebs <usenet-nospam@seebs.net> - 2011-08-20 06:32 +0000
    Re: sed question hsteenkamp@lycos.com - 2011-08-20 00:11 -0700
      Re: sed question Michael Vilain <vilain@NOspamcop.net> - 2011-08-20 00:19 -0700
      Re: sed question Seebs <usenet-nospam@seebs.net> - 2011-08-20 07:23 +0000
        Re: sed question hsteenkamp@lycos.com - 2011-08-20 02:06 -0700
          Re: sed question Seebs <usenet-nospam@seebs.net> - 2011-08-20 10:03 +0000
            Re: sed question hsteenkamp@lycos.com - 2011-08-20 04:51 -0700
              Re: sed question Janis Papanagnou <janis_papanagnou@hotmail.com> - 2011-08-20 14:59 +0300
                Re: sed question hsteenkamp@lycos.com - 2011-08-20 05:16 -0700
                Re: sed question Janis Papanagnou <janis_papanagnou@hotmail.com> - 2011-08-20 15:47 +0300
                Re: sed question hsteenkamp@lycos.com - 2011-08-20 06:35 -0700
      Re: sed question Ed Morton <mortonspam@gmail.com> - 2011-08-20 07:36 -0500
        Re: sed question Loki Harfagr <l0k1@thedarkdesign.free.fr.INVALID> - 2011-08-20 13:28 +0000
          Re: sed question Jens Schweikhardt <usenet@schweikhardt.net> - 2011-08-20 16:24 +0000
            Re: sed question Loki Harfagr <l0k1@thedarkdesign.free.fr.INVALID> - 2011-08-20 18:03 +0000
              Re: sed question pk <pk@pk.invalid> - 2011-08-20 23:06 +0200
        Re: sed question Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-08-21 03:07 +0100
          Re: sed question Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-08-21 03:09 +0100
          Re: sed question Ed Morton <mortonspam@gmail.com> - 2011-08-20 21:24 -0500
            Re: sed question Janis Papanagnou <janis_papanagnou@hotmail.com> - 2011-08-21 06:07 +0300
              Re: sed question Ed Morton <mortonspam@gmail.com> - 2011-08-20 23:08 -0500
                Re: sed question Janis Papanagnou <janis_papanagnou@hotmail.com> - 2011-08-21 15:21 +0300
                Re: sed question Loki Harfagr <l0k1@thedarkdesign.free.fr.INVALID> - 2011-08-21 13:40 +0000
                Re: sed question Janis Papanagnou <janis_papanagnou@hotmail.com> - 2011-08-22 22:25 +0300
                Re: sed question Aragorn <stryder@telenet.be.invalid> - 2011-08-22 22:03 +0200
                Re: sed question Janis Papanagnou <janis_papanagnou@hotmail.com> - 2011-08-22 23:33 +0300
                Re: sed question Loki Harfagr <l0k1@thedarkdesign.free.fr.INVALID> - 2011-08-22 21:28 +0000
            Re: sed question Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-08-21 16:05 +0100
              Re: sed question pk <pk@pk.invalid> - 2011-08-21 17:09 +0200
              Re: sed question Ed Morton <mortonspam@gmail.com> - 2011-08-21 10:58 -0500
                Re: sed question Rakesh Sharma <sharma__r@hotmail.com> - 2011-08-22 15:11 -0700
                Re: sed question Ed Morton <mortonspam@gmail.com> - 2011-08-22 19:17 -0500
                Re: sed question "Ed Morton" <mortonspam@gmail.com> - 2011-08-23 16:57 +0000
                Re: sed question Rakesh Sharma <sharma__r@hotmail.com> - 2011-09-04 06:17 -0700
        Re: sed question Marc Girod <marc.girod@gmail.com> - 2011-08-21 06:30 -0700
          Re: sed question merlyn@stonehenge.com (Randal L. Schwartz) - 2011-08-21 08:10 -0700
  Re: sed question "Chris F.A. Johnson" <cfajohnson@gmail.com> - 2011-08-20 18:50 -0400
    Re: sed question Stephane CHAZELAS <stephane_chazelas@yahoo.fr> - 2011-08-22 17:46 +0000

csiph-web