Re: changing string occurencies in a line up to a delimiter
From: Dana French (dfrench_at_mtxia.com)
Date: 09/09/04
- Next message: wilson: "Re: Why 'alias' cannot run by shell script?"
- Previous message: Dana French: "Re: Why 'alias' cannot run by shell script?"
- In reply to: Stephane CHAZELAS: "Re: changing string occurencies in a line up to a delimiter"
- Next in thread: Stephane CHAZELAS: "Re: changing string occurencies in a line up to a delimiter"
- Reply: Stephane CHAZELAS: "Re: changing string occurencies in a line up to a delimiter"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 8 Sep 2004 15:53:50 -0700
Stephane CHAZELAS <this.address@is.invalid> wrote in message news:<slrncju9ip.1i0.stephane.chazelas@spam.is.invalid>...
> 2004-09-8, 08:09(-07), Dana French:
> [...]
> > A ksh93 solution:
> >
> > #!/usr/bin/ksh93
> > while IFS='@' read -r -- PART1 PART2
> > do
> > RESULT="${PART2:+${PART1//<[Bb][Rr]>/}@${PART2}}"
> > print "${RESULT:-${PART1//<[Bb][Rr]>/}}"
> > done < file.in
> [...]
>
> For a file like:
>
> <<
> @@@
> A<br>B@
> -n
> A\nB
> >>
>
> it gives:
>
> <<
> @@@
> AB
> A
> B
> >>
The file contents you suggest in your post were not indicated by the
OP. The ksh93 solution I provided solved the question that was asked.
--------------------------------------------------------
Dana French dfrench@mtxia.com
Mt Xia Technical Consulting Group http://www.mtxia.com
100% Spam Free Email http://www.ridmail.com
MicroEmacs http://uemacs.tripod.com
Korn Shell Web http://dfrench.tripod.com/kshweb.html
- Next message: wilson: "Re: Why 'alias' cannot run by shell script?"
- Previous message: Dana French: "Re: Why 'alias' cannot run by shell script?"
- In reply to: Stephane CHAZELAS: "Re: changing string occurencies in a line up to a delimiter"
- Next in thread: Stephane CHAZELAS: "Re: changing string occurencies in a line up to a delimiter"
- Reply: Stephane CHAZELAS: "Re: changing string occurencies in a line up to a delimiter"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|