develooper Front page | perl.perl5.porters | Postings from April 2013

Re: [perl #115708] Do a better job of escaping components of ldlibpthfor the shell

Thread Previous | Thread Next
From:
Gisle Aas
Date:
April 17, 2013 20:23
Subject:
Re: [perl #115708] Do a better job of escaping components of ldlibpthfor the shell
Message ID:
CAMx+QJ64NDNBd4J4qPsVpcPXBorWGDrWPEq69_Pv89CD4MyAVA@mail.gmail.com
On Wed, Apr 17, 2013 at 5:36 PM, Eric Brine <ikegami@adaelis.com> wrote:
> Reopened ticket. Will get a patch out shortly. If you want, you can run the
> following to make sure it'll work:
>
> quote() { case "$1" in '') echo "''" ;; *)  echo "$1" | sed
> 's/\([^a-zA-Z0-9.:_\-\/]\)/\\\1/g' ;; esac; }
> x=\(bar\)
> mkdir \(foo\)
> cd \(foo\)
> pwd="`pwd`"
> ldlibpth="x=` quote "$pwd" `:` quote "$x" `"
> echo "$ldlibpth"
>
> Should give:
>
> x=/home/ikegami/\(foo\):\(bar\)

I've verified that this does give the expected result with the Solaris
/bin/sh.  Thanks!

--Gisle

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About