Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.unix.shell > #1750
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | Jens Schweikhardt <usenet@schweikhardt.net> |
| Newsgroups | comp.unix.shell |
| Subject | Re: sed question |
| Date | 20 Aug 2011 16:24:32 GMT |
| Lines | 48 |
| Sender | Jens Schweikhardt <schweikh@hal9000.schweikhardt.net> |
| Message-ID | <9ba5e0Fsr3U1@mid.individual.net> (permalink) |
| References | <ff8c75fa-c98a-40ab-9c1b-968e7e7e606b@d8g2000prf.googlegroups.com> <slrnj4ul6l.ne0.usenet-nospam@guild.seebs.net> <4117265f-36d6-481d-bf13-f618e0e08e30@g39g2000pro.googlegroups.com> <j2o9nn$hgi$1@dont-email.me> <pan.2011.08.20.13.28.42@thedarkdesign.free.fr.INVALID> |
| X-Trace | individual.net P5PbSrDnivIp6p33dZWsTAmOa2Dcch9XL0kvUjVbioQVChVhoc |
| X-Orig-Path | not-for-mail |
| Cancel-Lock | sha1:4l3TcEyaXVlmfBfbFmDVrxVVzpU= |
| User-Agent | tin/1.9.6-20101126 ("Burnside") (UNIX) (FreeBSD/9.0-CURRENT (i386)) |
| Xref | x330-a1.tempe.blueboxinc.net comp.unix.shell:1750 |
Show key headers only | View raw
Loki Harfagr <l0k1@thedarkdesign.free.fr.invalid> wrote
in <pan.2011.08.20.13.28.42@thedarkdesign.free.fr.INVALID>:
...
# Not at all Ed., (this is c.u.s. ;-), it's the very cleanest sed code:
#
# test file:
# -------
# $ cat /dev/shm/BLOP
# a bc dddd
# 1 2 3 4
# 5
# sixtine eye
# .
# -------
#
# PoC:
# -------
# $ sed /dev/shm/BLOP
# a bc dddd
# a bc dddd
# 1 2 3 4
# 1 2 3 4
# 5
# 5
# sixtine eye
# sixtine eye
# .
# .
# -------
#
# here they go:
# -------
# $ sed() { while read lee; do echo "${lee}" ; echo "${lee}" ; done<"${1}" ; }
# -------
#
# to OP, mind to cleanse a bit afterwards ;-) (e-g: unset sed)
# and of course it may not work in your shell if it doesn't bear functions
# and/or some settings for records are tweaked in it...
And it doesn't work for lines with initial and trailing whitespace,
for lines with backslashes, and probably some more.
Regards,
Jens
--
Jens Schweikhardt http://www.schweikhardt.net/
SIGSIG -- signature too long (core dumped)
Back to comp.unix.shell | Previous | Next — Previous in thread | Next in thread | Find similar
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