<?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: sed Issue .. (delimiter) in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-issue/m-p/5803955#M638513</link>
    <description>&lt;P&gt;&amp;gt;it seems that the issue happens when the password hash has a \ or / in it&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could replace that sed "/" by a comma.&lt;/P&gt;</description>
    <pubDate>Fri, 14 Sep 2012 20:10:14 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2012-09-14T20:10:14Z</dc:date>
    <item>
      <title>Sed Issue ..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-issue/m-p/5803809#M638511</link>
      <description>&lt;P&gt;I everyone I need some help with a sed statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a scirpt that updates the /etc/shadow on linux and solaris.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I am having probems with one line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ssh -q ${HOST} 2&amp;gt;/dev/null "rm /tmp/shadow.*"&lt;BR /&gt;ssh -q ${HOST} 2&amp;gt;/dev/null "cp /etc/shadow /tmp/shadow.bak"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ssh -q ${HOST} 2&amp;gt;/dev/null "sed -e '/^root:/s/:[^:]*:/:${PASS}:/' /tmp/shadow.bak &amp;gt; /tmp/shadow.new"&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Most of the time it works without any issues but for some reason everyone once in a while /tmp/shadow.new is empty. The file is there .. just nothing in it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-rw-------&amp;nbsp;&amp;nbsp; 1 root&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; root&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 Sep 14 10:32 /tmp/shadow.new&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there something wrong with my sed staement?&lt;/P&gt;&lt;P&gt;Or am I missing something?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks&lt;/P&gt;&lt;P&gt;Ricardo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2012 15:40:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-issue/m-p/5803809#M638511</guid>
      <dc:creator>rleon</dc:creator>
      <dc:date>2012-09-14T15:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: Sed Issue ..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-issue/m-p/5803923#M638512</link>
      <description>&lt;P&gt;Im a little closer ..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it seems that the issue happens when the password hash has a \ or / in it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the following errors:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sed: command garbled:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sed: -e expression #1, char 29: Unknown option to `s'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2012 18:25:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-issue/m-p/5803923#M638512</guid>
      <dc:creator>rleon</dc:creator>
      <dc:date>2012-09-14T18:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: sed Issue .. (delimiter)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-issue/m-p/5803955#M638513</link>
      <description>&lt;P&gt;&amp;gt;it seems that the issue happens when the password hash has a \ or / in it&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could replace that sed "/" by a comma.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2012 20:10:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-issue/m-p/5803955#M638513</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2012-09-14T20:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: Sed Issue ..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-issue/m-p/5803975#M638514</link>
      <description>&lt;P&gt;Hi Dennis&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you clarify ..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the password hash is&lt;/P&gt;&lt;P&gt;abcdef123/ABC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I change it to&lt;/P&gt;&lt;P&gt;abcdef123,ABC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That makes the password different and doesnt work.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2012 19:26:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-issue/m-p/5803975#M638514</guid>
      <dc:creator>rleon</dc:creator>
      <dc:date>2012-09-14T19:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: sed Issue .. (delimiter)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-issue/m-p/5804005#M638515</link>
      <description>&lt;P&gt;&amp;gt;Can you clarify?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Change your sed command to use "," as the delimiter:&lt;/P&gt;&lt;P&gt;ssh -q ${HOST} 2&amp;gt; /dev/null "sed -e '/^root:/s,:[^:]*:,:${PASS}:,' /tmp/shadow.bak &amp;gt; /tmp/shadow.new"&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2012 20:10:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-issue/m-p/5804005#M638515</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2012-09-14T20:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: sed Issue .. (delimiter)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-issue/m-p/5804015#M638516</link>
      <description>&lt;P&gt;Thanks !!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That worked like a charm !!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Woud you mind explaining what the comma does?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2012 20:21:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-issue/m-p/5804015#M638516</guid>
      <dc:creator>rleon</dc:creator>
      <dc:date>2012-09-14T20:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: sed Issue .. (delimiter)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-issue/m-p/5804135#M638517</link>
      <description>&lt;P&gt;&amp;gt;Would you mind explaining what the comma does?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The same as the "/".&amp;nbsp; :-)&lt;/P&gt;&lt;P&gt;You can use any char as the delimiter, as long as it matches.&amp;nbsp; From sed(1):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (2)s/regular expression/replacement/flags&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Substitute replacement string for instances of regular&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; expression in the pattern space.&amp;nbsp; Any character can be&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; used instead of /.&amp;nbsp; For a fuller description see ed(1).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems you can even use a ";", though it is normally a command separator.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Sep 2012 01:44:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-issue/m-p/5804135#M638517</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2012-09-15T01:44:40Z</dc:date>
    </item>
  </channel>
</rss>

