<?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 in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2562980#M725136</link>
    <description>Hello Matt,&lt;BR /&gt;&lt;BR /&gt;Here is one way to try it.  I wrote a little script named fixit that takes the old server name and the new server name as parameters.  It looks like this:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;# fixit&lt;BR /&gt;&lt;BR /&gt;OLDSRV=$1&lt;BR /&gt;NEWSRV=$2&lt;BR /&gt;&lt;BR /&gt;sed "s/SERVER = $OLDSRV/SERVER = $NEWSRV/" test.txt&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;(Where test.txt is the name of the file with your text.)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Then you can run it like this:&lt;BR /&gt;&lt;BR /&gt;fixit miami tampa&lt;BR /&gt;&lt;BR /&gt;And you get something like this:&lt;BR /&gt;&lt;BR /&gt;SERVER = tampa&lt;BR /&gt;DOMAIN = florida&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I'm sure the other wizards will have even cooler ways to do it, but that is a start.&lt;BR /&gt;&lt;BR /&gt;JP&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 07 Aug 2001 22:07:26 GMT</pubDate>
    <dc:creator>John Poff</dc:creator>
    <dc:date>2001-08-07T22:07:26Z</dc:date>
    <item>
      <title>sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2562979#M725135</link>
      <description>I'm looking to use the 'sed' command to update a simple text file, but am having a little trouble with the syntax.&lt;BR /&gt;Ex. text file:&lt;BR /&gt;SERVER = miami&lt;BR /&gt;DOMAIN = florida&lt;BR /&gt;&lt;BR /&gt;I need to update the SERVER entry with a variable parameter that is passed into the script.  I've tried to use /s for substitution, but I can't subsitute for "SERVER = miami" since 'miami' may not always be the value.  Also, I've found that wildcards aren't accepted.  The only option I see would be to use the 'c\' option with sed, but I may run into the same problem.  Any suggestions?&lt;BR /&gt;&lt;BR /&gt;Any help is appreciated.&lt;BR /&gt;Thanks in advance!&lt;BR /&gt;-Matt</description>
      <pubDate>Tue, 07 Aug 2001 21:40:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2562979#M725135</guid>
      <dc:creator>Matt Dunfee</dc:creator>
      <dc:date>2001-08-07T21:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2562980#M725136</link>
      <description>Hello Matt,&lt;BR /&gt;&lt;BR /&gt;Here is one way to try it.  I wrote a little script named fixit that takes the old server name and the new server name as parameters.  It looks like this:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;# fixit&lt;BR /&gt;&lt;BR /&gt;OLDSRV=$1&lt;BR /&gt;NEWSRV=$2&lt;BR /&gt;&lt;BR /&gt;sed "s/SERVER = $OLDSRV/SERVER = $NEWSRV/" test.txt&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;(Where test.txt is the name of the file with your text.)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Then you can run it like this:&lt;BR /&gt;&lt;BR /&gt;fixit miami tampa&lt;BR /&gt;&lt;BR /&gt;And you get something like this:&lt;BR /&gt;&lt;BR /&gt;SERVER = tampa&lt;BR /&gt;DOMAIN = florida&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I'm sure the other wizards will have even cooler ways to do it, but that is a start.&lt;BR /&gt;&lt;BR /&gt;JP&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 07 Aug 2001 22:07:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2562980#M725136</guid>
      <dc:creator>John Poff</dc:creator>
      <dc:date>2001-08-07T22:07:26Z</dc:date>
    </item>
    <item>
      <title>Re: sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2562981#M725137</link>
      <description>Assuming the new value is in variable NEWSERVER:&lt;BR /&gt;&lt;BR /&gt;sed "/SERVER/s/=.*/=$NEWSERVER/"&lt;BR /&gt;&lt;BR /&gt;Note double quotes and the period before * (wildcards in sed are different than in shell).</description>
      <pubDate>Sun, 12 Aug 2001 16:24:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2562981#M725137</guid>
      <dc:creator>Tapani Tarvainen</dc:creator>
      <dc:date>2001-08-12T16:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2562982#M725138</link>
      <description>Hi&lt;BR /&gt;  You can have something like, in the script ( a.sh )&lt;BR /&gt;&lt;BR /&gt;sed 's/^\(SERVER = \).*/\1'$1'/' a.txt&lt;BR /&gt;&lt;BR /&gt;you can run it like&lt;BR /&gt;&lt;BR /&gt;./a.sh newserver&lt;BR /&gt;&lt;BR /&gt;The newserver name will replac the old name.&lt;BR /&gt;&lt;BR /&gt;..BPK...&lt;BR /&gt;</description>
      <pubDate>Mon, 13 Aug 2001 04:58:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2562982#M725138</guid>
      <dc:creator>Praveen Bezawada</dc:creator>
      <dc:date>2001-08-13T04:58:39Z</dc:date>
    </item>
  </channel>
</rss>

