<?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: parsing sed command using a variable that has a special character in it in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/parsing-sed-command-using-a-variable-that-has-a-special/m-p/3178033#M718164</link>
    <description>I don't now if the / is the only special character, but you can replace this in the sed command for example with |(pipe)&lt;BR /&gt;sed 's|abc|def|'&lt;BR /&gt;&lt;BR /&gt;I hope this helps.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Peter</description>
    <pubDate>Thu, 29 Jan 2004 15:08:54 GMT</pubDate>
    <dc:creator>Hoefnix</dc:creator>
    <dc:date>2004-01-29T15:08:54Z</dc:date>
    <item>
      <title>parsing sed command using a variable that has a special character in it</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parsing-sed-command-using-a-variable-that-has-a-special/m-p/3178032#M718163</link>
      <description>Can this be done in ksh or PERL or will I have to use C?  I have a variable called save_passwd that can contain any sized encrypted passwd with special characters in it. If my orig_passwd is changed from save_passwd I want to replace save_passwd with orig_passwd.  But I can't use a simple sed command because of the special character in the encrypted passwd.  The sed command will not be parsed when the variables have these values in them.  See my sample:&lt;BR /&gt;&lt;BR /&gt;save_passwd=4/ZZcVJkiflO3w&lt;BR /&gt;orig_passwd=t98zVK47301.27&lt;BR /&gt;&lt;BR /&gt;eval sed -e 's/${user}:"${save_passwd}":${save_dt}/${user}:"${orig_passwd}":${exp_dt}/' /passwd_work/copy_passwd &amp;gt; /passwd_work/copy_passwd.tmp&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Jan 2004 15:04:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parsing-sed-command-using-a-variable-that-has-a-special/m-p/3178032#M718163</guid>
      <dc:creator>Dave Cassel</dc:creator>
      <dc:date>2004-01-29T15:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: parsing sed command using a variable that has a special character in it</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parsing-sed-command-using-a-variable-that-has-a-special/m-p/3178033#M718164</link>
      <description>I don't now if the / is the only special character, but you can replace this in the sed command for example with |(pipe)&lt;BR /&gt;sed 's|abc|def|'&lt;BR /&gt;&lt;BR /&gt;I hope this helps.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Peter</description>
      <pubDate>Thu, 29 Jan 2004 15:08:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parsing-sed-command-using-a-variable-that-has-a-special/m-p/3178033#M718164</guid>
      <dc:creator>Hoefnix</dc:creator>
      <dc:date>2004-01-29T15:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: parsing sed command using a variable that has a special character in it</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parsing-sed-command-using-a-variable-that-has-a-special/m-p/3178034#M718165</link>
      <description>assuming that the variable is set in the shell's environment, one can access it in a parl statement through the %ENV hash. Above example would roughly translate to&lt;BR /&gt;&lt;BR /&gt;perl -pe's/$ENV{user}:$ENV{save_passwd}:$ENV{save_dt}/$ENV{user}:$ENV{orig_passwd}:$ENV{exp_dt}/' /passwd_work/copy_passwd &amp;gt; /passwd_work/copy_passwd.tmp&lt;BR /&gt;&lt;BR /&gt;perl can also do in-line edit. see 'man perlrun' under the option -i&lt;BR /&gt;&lt;BR /&gt;Above example looks like the commands in the context leading towards this question could be done in perl too&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Thu, 29 Jan 2004 15:17:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parsing-sed-command-using-a-variable-that-has-a-special/m-p/3178034#M718165</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2004-01-29T15:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: parsing sed command using a variable that has a special character in it</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parsing-sed-command-using-a-variable-that-has-a-special/m-p/3178035#M718166</link>
      <description>Thanks so much!  I didn't realize this reg expression can be delimited by any character except newline.  I also just found your answer in the O'Reilly Sed &amp;amp; Awk book pg. 81!</description>
      <pubDate>Thu, 29 Jan 2004 15:45:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parsing-sed-command-using-a-variable-that-has-a-special/m-p/3178035#M718166</guid>
      <dc:creator>Dave Cassel</dc:creator>
      <dc:date>2004-01-29T15:45:43Z</dc:date>
    </item>
  </channel>
</rss>

