Re: [HACKERS] Re: [SQL] plpgsql error

From: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL-development <hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] Re: [SQL] plpgsql error
Date: 1999-05-11 15:52:24
Message-ID: 199905111552.QAA07105@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
>Any shell-scripting gurus on the list? I thought this would be an easy
>fix, but I'm having some difficulty getting the configure script to
>produce a fully-expanded value for libdir. Given a shell variable that
>may contain $-references to other variables, the requirement is to
>assign to a new variable an expanded value containing no $-references.
>I tried
> expanded_libdir="$libdir"
>but that just gets you an exact copy, no recursive expansion. A few
>other ideas didn't work either; the Bourne shell doesn't seem to want
>to re-expand text it's already expanded. Suggestions?

Use eval:

$ v1=DF_\$EIFFEL_GTK
$ echo $v1
DF_$EIFFEL_GTK
$ v2=$v1
$ echo $v2
DF_$EIFFEL_GTK
$ eval v2=$v1
$ echo $v2
DF_/usr/lib/eiffel-gtk
$

but if it gets too complicated, you might have to change to Perl

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
PGP key from public servers; key ID 32B8FAA1
========================================
"Search me, O God, and know my heart; try me, and know
my thoughts. And see if there be any wicked way in me,
and lead me in the way everlasting."
Psalms 139:23,24

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 1999-05-11 16:01:54 Re: [HACKERS] 6.5 TODO list
Previous Message Oleg Bartunov 1999-05-11 15:44:58 Re: [HACKERS] 6.5 cvs ERROR: copyObject: don't know how to copy 604