<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Variable probleme in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/variable-probleme/m-p/5179185#M50872</link>
    <description>&lt;!--!*#--&gt;Some of those characters don't copy+paste on&lt;BR /&gt;my system, so I can't tell what they really&lt;BR /&gt;are, but inside apostrophes, variables are&lt;BR /&gt;not evaluated.  For example:&lt;BR /&gt;&lt;BR /&gt;alp$ E='a b c'&lt;BR /&gt;alp$ echo ${E}&lt;BR /&gt;a b c&lt;BR /&gt;alp$ echo "${E}"&lt;BR /&gt;a b c&lt;BR /&gt;alp$ echo '${E}'&lt;BR /&gt;${E}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;"man sh"?  Buy a book?</description>
    <pubDate>Wed, 03 Jun 2009 18:02:26 GMT</pubDate>
    <dc:creator>Steven Schweda</dc:creator>
    <dc:date>2009-06-03T18:02:26Z</dc:date>
    <item>
      <title>Variable probleme</title>
      <link>https://community.hpe.com/t5/operating-system-linux/variable-probleme/m-p/5179182#M50869</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Here my call&lt;BR /&gt;&lt;BR /&gt;find /su01/opus/html/*.html -type f -exec perl -i -pe 's|\Q’$ENVSOURCE’\E|’$ENVDEST’|g' {} \;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The problem is that $ENVSOURCE and $ENVDEST are never evaluated. Why ?&lt;BR /&gt;&lt;BR /&gt;Bests Regards&lt;BR /&gt;Den&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Jun 2009 17:39:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/variable-probleme/m-p/5179182#M50869</guid>
      <dc:creator>Leo The Cat</dc:creator>
      <dc:date>2009-06-03T17:39:48Z</dc:date>
    </item>
    <item>
      <title>Re: Variable probleme</title>
      <link>https://community.hpe.com/t5/operating-system-linux/variable-probleme/m-p/5179183#M50870</link>
      <description>I have tried ${ENVSOURCE} without success&lt;BR /&gt;I have tried $($ENVSOURCE) without success&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Jun 2009 17:44:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/variable-probleme/m-p/5179183#M50870</guid>
      <dc:creator>Leo The Cat</dc:creator>
      <dc:date>2009-06-03T17:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: Variable probleme</title>
      <link>https://community.hpe.com/t5/operating-system-linux/variable-probleme/m-p/5179184#M50871</link>
      <description>Important note&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;find /su01/opus/html/*.html -type f -exec perl -i -pe 's|\Qâ  $ENVSOURCEâ  \E|â  $ENVDESTâ  |g' {} \;&lt;BR /&gt;&lt;BR /&gt;Works perfectly in a command line mode. &lt;BR /&gt;&lt;BR /&gt;The problem is when I have trued to put this command in a ksh script !&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Bests regards&lt;BR /&gt;Den&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Jun 2009 17:59:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/variable-probleme/m-p/5179184#M50871</guid>
      <dc:creator>Leo The Cat</dc:creator>
      <dc:date>2009-06-03T17:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: Variable probleme</title>
      <link>https://community.hpe.com/t5/operating-system-linux/variable-probleme/m-p/5179185#M50872</link>
      <description>&lt;!--!*#--&gt;Some of those characters don't copy+paste on&lt;BR /&gt;my system, so I can't tell what they really&lt;BR /&gt;are, but inside apostrophes, variables are&lt;BR /&gt;not evaluated.  For example:&lt;BR /&gt;&lt;BR /&gt;alp$ E='a b c'&lt;BR /&gt;alp$ echo ${E}&lt;BR /&gt;a b c&lt;BR /&gt;alp$ echo "${E}"&lt;BR /&gt;a b c&lt;BR /&gt;alp$ echo '${E}'&lt;BR /&gt;${E}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;"man sh"?  Buy a book?</description>
      <pubDate>Wed, 03 Jun 2009 18:02:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/variable-probleme/m-p/5179185#M50872</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2009-06-03T18:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: Variable probleme</title>
      <link>https://community.hpe.com/t5/operating-system-linux/variable-probleme/m-p/5179186#M50873</link>
      <description>Sorry but I have no time to become a caid on sh ! It's because I come here !</description>
      <pubDate>Wed, 03 Jun 2009 18:06:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/variable-probleme/m-p/5179186#M50873</guid>
      <dc:creator>Leo The Cat</dc:creator>
      <dc:date>2009-06-03T18:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Variable probleme</title>
      <link>https://community.hpe.com/t5/operating-system-linux/variable-probleme/m-p/5179187#M50874</link>
      <description>As methioned above, replace single quotes by double quotes if you can. Single quotes prevents the variables from being subtituted.&lt;BR /&gt;&lt;BR /&gt;Probably, you should write a perl script and call the script from the find command. I don't know much about perl.</description>
      <pubDate>Wed, 03 Jun 2009 18:06:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/variable-probleme/m-p/5179187#M50874</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2009-06-03T18:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: Variable probleme</title>
      <link>https://community.hpe.com/t5/operating-system-linux/variable-probleme/m-p/5179188#M50875</link>
      <description>Hi Den:&lt;BR /&gt;&lt;BR /&gt;The $ENVSOURCE and $ENVDEST are Perl's variables, not the shell's.  All you need do is this:&lt;BR /&gt;&lt;BR /&gt;# export ENVSOURCE=oldthing&lt;BR /&gt;# export ENVDEST=newthing&lt;BR /&gt;&lt;BR /&gt;# perl -i.old -pe 'BEGIN{$ENVSOURCE=$ENV{ENVSOURCE};$ENVDEST=$ENV{ENVDEST};};s|\Q.$ENVSOURCE.\E|.$ENVDEST.|g' file&lt;BR /&gt;&lt;BR /&gt;Thus we export to the environment in which Perl will run and then tell Perl to use the exported environmental variables.&lt;BR /&gt;&lt;BR /&gt;Obviously you can couple this with your shell find() as you wrote.  You could also use Perl's 'File::Find' module directory.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 03 Jun 2009 20:38:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/variable-probleme/m-p/5179188#M50875</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-06-03T20:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: Variable probleme</title>
      <link>https://community.hpe.com/t5/operating-system-linux/variable-probleme/m-p/5179189#M50876</link>
      <description>James and Ivan give me the good way. &lt;BR /&gt;Thanks Guys</description>
      <pubDate>Tue, 15 Sep 2009 11:18:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/variable-probleme/m-p/5179189#M50876</guid>
      <dc:creator>Leo The Cat</dc:creator>
      <dc:date>2009-09-15T11:18:25Z</dc:date>
    </item>
  </channel>
</rss>

