<?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 4.x broken? in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/sed-4-x-broken/m-p/3395476#M70931</link>
    <description>Try escaping the minus signs.  Perhaps sed&lt;BR /&gt;4.x is interpreting them as metacharacters.</description>
    <pubDate>Mon, 11 Oct 2004 12:02:22 GMT</pubDate>
    <dc:creator>Gregory Fruth</dc:creator>
    <dc:date>2004-10-11T12:02:22Z</dc:date>
    <item>
      <title>SED 4.x broken?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/sed-4-x-broken/m-p/3395473#M70928</link>
      <description>Hello all, I've been trying to port a script of mine from SLES8 to SLES9, been pretty plain sailing so far as there aren't a great deal of differences, however I've just found a real show stopper, I'd like to know if anyone has the same problem to find out who to raise it with!&lt;BR /&gt;&lt;BR /&gt;My SLES8 box runs sed 3.02.80.&lt;BR /&gt;My SLES9 box runs sed 4.0.9.&lt;BR /&gt;&lt;BR /&gt;My script tries to identify what the config file for snmp is by checking the cmdline for it in the proc filesystem. The line is this:&lt;BR /&gt;&lt;BR /&gt;SNMP_PID=`cat /var/run/snmpd.pid`&lt;BR /&gt;SNMP_CONFIG=`sed -e 's/^.*-c//' -e 's/-r.*$//' /proc/$SNMP_PID/cmdline`&lt;BR /&gt;&lt;BR /&gt;However, use of the ^ &amp;amp; $ don't do anything in SLES9, but in SLES8, it'll strip out everthing before the -c and strip out everything after -r leaving me with the config file for snmp.&lt;BR /&gt;&lt;BR /&gt;Does anyone else have this problem with sed on their systems? Are you all able to use ^ &amp;amp; $? I've tried the sed statement with single and double quotes with no difference...&lt;BR /&gt;&lt;BR /&gt;I'm lost!</description>
      <pubDate>Thu, 07 Oct 2004 09:14:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/sed-4-x-broken/m-p/3395473#M70928</guid>
      <dc:creator>Michael Williams_6</dc:creator>
      <dc:date>2004-10-07T09:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: SED 4.x broken?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/sed-4-x-broken/m-p/3395474#M70929</link>
      <description>hi michael,&lt;BR /&gt;&lt;BR /&gt;sorry i'm not very good with sed but i have tried your cmdline and it doesn't work on my fedora core 2 (sed 4.0.8).&lt;BR /&gt;&lt;BR /&gt;but i have a workaround for you (i hope you can read it, it's not very nice without tabs):&lt;BR /&gt;&lt;BR /&gt;TEMP_PAR_FILE="/tmp/GetSnmpConfigFile.$$"&lt;BR /&gt;NEXT="false"&lt;BR /&gt;SNMP_PID='/var/run/snmpd.pid'&lt;BR /&gt;&lt;BR /&gt;rm -f $TEMP_PAR_FILE&lt;BR /&gt;&lt;BR /&gt;for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30; do&lt;BR /&gt;awk -F '\00' {" print \$$i "} /proc/$SNMP_PID/cmdline &amp;gt;&amp;gt; $TEMP_PAR_FILE&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;for i in `cat $TEMP_PAR_FILE` do&lt;BR /&gt;if [ $NEXT == 'true' ]; then&lt;BR /&gt;SNMP_CONFIG="$i"&lt;BR /&gt;NEXT="false"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;if [ $i == '-c' ]; then&lt;BR /&gt;NEXT="true"&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;rm -f $TEMP_PAR_FILE&lt;BR /&gt;&lt;BR /&gt;echo $SNMP_CONFIG</description>
      <pubDate>Fri, 08 Oct 2004 02:38:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/sed-4-x-broken/m-p/3395474#M70929</guid>
      <dc:creator>Johannes Krackowizer_1</dc:creator>
      <dc:date>2004-10-08T02:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: SED 4.x broken?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/sed-4-x-broken/m-p/3395475#M70930</link>
      <description>Hi there!&lt;BR /&gt;&lt;BR /&gt;Thank you very much for your suggestion of a work-around!&lt;BR /&gt;&lt;BR /&gt;Unfortunately while sed isn't working with the ^ &amp;amp; $, perl does, so I have a workaround already with perl:&lt;BR /&gt;&lt;BR /&gt;perl -p -e "s/^.*-c//; s/-r.*$//" cmdline&lt;BR /&gt;&lt;BR /&gt;I just want to see if this is a sed issue or a SuSE issue. I see that as you have the same problem, I'm guessing the programmers have intentionally removed this functionality...&lt;BR /&gt;&lt;BR /&gt;But why?!!</description>
      <pubDate>Fri, 08 Oct 2004 02:48:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/sed-4-x-broken/m-p/3395475#M70930</guid>
      <dc:creator>Michael Williams_6</dc:creator>
      <dc:date>2004-10-08T02:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: SED 4.x broken?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/sed-4-x-broken/m-p/3395476#M70931</link>
      <description>Try escaping the minus signs.  Perhaps sed&lt;BR /&gt;4.x is interpreting them as metacharacters.</description>
      <pubDate>Mon, 11 Oct 2004 12:02:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/sed-4-x-broken/m-p/3395476#M70931</guid>
      <dc:creator>Gregory Fruth</dc:creator>
      <dc:date>2004-10-11T12:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: SED 4.x broken?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/sed-4-x-broken/m-p/3395477#M70932</link>
      <description>My good man, I so thought you had it then...&lt;BR /&gt;&lt;BR /&gt;Only that didn't work either :-(</description>
      <pubDate>Thu, 14 Oct 2004 09:46:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/sed-4-x-broken/m-p/3395477#M70932</guid>
      <dc:creator>Michael Williams_6</dc:creator>
      <dc:date>2004-10-14T09:46:25Z</dc:date>
    </item>
  </channel>
</rss>

