[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: multiline output variables.
From: |
Noah Misch |
Subject: |
Re: multiline output variables. |
Date: |
Mon, 17 Jan 2005 13:37:03 -0800 |
User-agent: |
Mutt/1.5.6i |
On Mon, Jan 17, 2005 at 11:13:11AM +0100, Stepan Kasal wrote:
> On Fri, Jan 14, 2005 at 02:56:16AM -0800, Noah Misch wrote:
> > s/[^t]$/&\\/ does not do the job?
>
> I don't think so. What if the substituted value were "first\nsecond"?
> The newline wouldn't get escaped.
Oops. I stopped thinking far too quickly. Thanks.
> I think that if we choose a sufficiently unusual delimiter, we can go with
> it. I suggest that we use the delimiter "@!_!#_ \n" (the last two characters
> are space and newline).
That is much better.
If you wanted to avoid excluding any delimiter, you do something like this:
for ac_var in var1 var2 ... varN
do
eval "case \$$ac_var in
*'
'*) filter=' | sed '\\''\$q;s/\$/\\\\/'\\' ;;
*) filter= ;;
esac"
eval echo \"s,@$ac_var@,\$$ac_var,\;t t\" $filter
done | existing_cleanup_seds
- multiline output variables., Dan Manthey, 2005/01/13
- Re: multiline output variables., Noah Misch, 2005/01/14
- Re: multiline output variables., Stepan Kasal, 2005/01/17
- Re: multiline output variables., Dan Manthey, 2005/01/17
- Re: multiline output variables.,
Noah Misch <=
- Re: multiline output variables., Stepan Kasal, 2005/01/18
- Re: multiline output variables., Dan Manthey, 2005/01/24
- Re: multiline output variables., Stepan Kasal, 2005/01/25
- Re: multiline output variables., Dan Manthey, 2005/01/25
- Re: multiline output variables., Stepan Kasal, 2005/01/27
- Re: multiline output variables., Stepan Kasal, 2005/01/28
- Re: multiline output variables., Ralf Wildenhues, 2005/01/28
- Re: multiline output variables., Stepan Kasal, 2005/01/28
- Re: multiline output variables., Paul Eggert, 2005/01/28
- Re: multiline output variables., Dan Manthey, 2005/01/25