Re: How to concatenate lines continued with '\'?
From: Dan Mercer (dmercer_at_mn.rr.com)
Date: 04/14/04
- Previous message: Bill Marcum: "Re: Crontab not working"
- In reply to: Heiner Steven: "How to concatenate lines continued with '\'?"
- Next in thread: Kenny McCormack: "Re: How to concatenate lines continued with '\'?"
- Reply: Kenny McCormack: "Re: How to concatenate lines continued with '\'?"
- Reply: Chris F.A. Johnson: "Re: How to concatenate lines continued with '\'?"
- Reply: Heiner Steven: "Re: How to concatenate lines continued with '\'?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 14 Apr 2004 16:56:11 GMT
"Heiner Steven" <heiner.steven@nexgo.de> wrote in message news:407c5449$0$20557$9b4e6d93@newsread4.arcor-online.net...
: I'm searching for the fastest and shortest way to
: concatenate lines continued with a backslash as
: a last character.
:
: Example:
:
: this is a \
: continued \
: line
:
: should be converted to
:
: this is a continued line
:
It's kinda funny that no one in comp.unix.shell suggested a shell
answer:
In Ksh
while IFS= read line
do
print -n -- "$line"
done < infile >outfile
In bash replace print with the appropriate echo statement.
I haven't tested with indented lines, but in that case you would
just add a "-r" to the read.
Dan Mercer
- Previous message: Bill Marcum: "Re: Crontab not working"
- In reply to: Heiner Steven: "How to concatenate lines continued with '\'?"
- Next in thread: Kenny McCormack: "Re: How to concatenate lines continued with '\'?"
- Reply: Kenny McCormack: "Re: How to concatenate lines continued with '\'?"
- Reply: Chris F.A. Johnson: "Re: How to concatenate lines continued with '\'?"
- Reply: Heiner Steven: "Re: How to concatenate lines continued with '\'?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|