<?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/2746585#M892702</link>
    <description>Hi&lt;BR /&gt;&lt;BR /&gt;To action this on a number of files in a directory&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;for file in *&lt;BR /&gt;do cat $file | sed s/rsh/remsh/g &amp;gt; newfile&lt;BR /&gt;cp newfile $file&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Steve&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 17 Jun 2002 21:38:14 GMT</pubDate>
    <dc:creator>steven Burgess_2</dc:creator>
    <dc:date>2002-06-17T21:38:14Z</dc:date>
    <item>
      <title>sed ????</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2746582#M892699</link>
      <description>sed ???  ( post #1) &lt;BR /&gt;&lt;BR /&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I am working on a project that require migration of a lot of scripts from an SGI IRIX to an HP-UX environment. These scripts may have a lot of statements that include "rsh" or other IRIX specific PATH statements.&lt;BR /&gt;&lt;BR /&gt;I would like to automate this migration as much as possible for example using sed to replace the word"rsh" with HP-UX "remsh".&lt;BR /&gt;&lt;BR /&gt;Can any one suggest a scripts that can do this change for me.&lt;BR /&gt;&lt;BR /&gt;Any help will be greatly appreciated.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 17 Jun 2002 21:07:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2746582#M892699</guid>
      <dc:creator>Nabil_2</dc:creator>
      <dc:date>2002-06-17T21:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: sed ????</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2746583#M892700</link>
      <description>Well, you can use sed but that means you have to keep up with making temp files, preserving permissions, and then mv'ing the temp file to the original. An easier way is to use Perl with the -i argument to create a backup and the -p argument to loop over the files.&lt;BR /&gt;&lt;BR /&gt;perl -p -i.bkup -e 's/rsh/remsh/g' file1 file2 ...&lt;BR /&gt;&lt;BR /&gt;Believe it or not, you are done and you have file1.bkup file2.bkup as well. If you leave off the .bkup (just use -i) then no backup will be created.&lt;BR /&gt;</description>
      <pubDate>Mon, 17 Jun 2002 21:29:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2746583#M892700</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-06-17T21:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: sed ????</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2746584#M892701</link>
      <description>Hi &lt;BR /&gt;&lt;BR /&gt;using sed from the command line&lt;BR /&gt;&lt;BR /&gt;sed s/rsh/remsh/g &lt;FILENAME&gt;&lt;BR /&gt;&lt;BR /&gt;will replace rsh with remsh in &lt;FILENAME&gt;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Steve&lt;/FILENAME&gt;&lt;/FILENAME&gt;</description>
      <pubDate>Mon, 17 Jun 2002 21:30:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2746584#M892701</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2002-06-17T21:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: sed ????</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2746585#M892702</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;To action this on a number of files in a directory&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;for file in *&lt;BR /&gt;do cat $file | sed s/rsh/remsh/g &amp;gt; newfile&lt;BR /&gt;cp newfile $file&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Steve&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 17 Jun 2002 21:38:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2746585#M892702</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2002-06-17T21:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: sed ????</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2746586#M892703</link>
      <description>Thank you both for replying.&lt;BR /&gt;I do like both solutions athough I really did not need to make any backup copies of original files in the perl example but I like the other shell sed solution...It worked for me....&lt;BR /&gt;&lt;BR /&gt;I think I will go with that.&lt;BR /&gt;&lt;BR /&gt;Thank you all very much.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 17 Jun 2002 21:52:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2746586#M892703</guid>
      <dc:creator>Nabil_2</dc:creator>
      <dc:date>2002-06-17T21:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: sed ????</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2746587#M892704</link>
      <description>That's fine but I assume that if you simply&lt;BR /&gt; &lt;BR /&gt;perl -p -i -e 's/rsh/remsh/g' *&lt;BR /&gt;&lt;BR /&gt;Then every file in the directory is done AND permissions/modes are preserved.&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Mon, 17 Jun 2002 22:12:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2746587#M892704</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-06-17T22:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: sed ????</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2746588#M892705</link>
      <description>Oops..&lt;BR /&gt;Sorry Guys,..I really don't mean to take the easy way out but I am not really scripting guru kind of guy ..&lt;BR /&gt;&lt;BR /&gt;This gave me another idea that I need to take care of also...&lt;BR /&gt;&lt;BR /&gt;Same thing except&lt;BR /&gt;&lt;BR /&gt;checking a certain custom host file and doing remote shell&lt;BR /&gt;&lt;BR /&gt;server1&lt;BR /&gt;server2&lt;BR /&gt;server3&lt;BR /&gt;etc..&lt;BR /&gt;&lt;BR /&gt;to that host then updating .rhost file from a certain host1 to host2...&lt;BR /&gt;&lt;BR /&gt;Please don't take this as me being lazy to learn scripting.. I really need this done by tomorrow....&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 17 Jun 2002 22:20:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2746588#M892705</guid>
      <dc:creator>Nabil_2</dc:creator>
      <dc:date>2002-06-17T22:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: sed ????</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2746589#M892706</link>
      <description>Nabil&lt;BR /&gt;&lt;BR /&gt;You can assign points for the answers that have helped you as a token of appreciation&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Mon, 17 Jun 2002 22:30:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2746589#M892706</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2002-06-17T22:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: sed ????</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2746590#M892707</link>
      <description>steven,&lt;BR /&gt;Please forgive me .. I did not mean to un appreciative ..&lt;BR /&gt;Everything posted here for me was very very helpful ..&lt;BR /&gt;Thank you for your help ...&lt;BR /&gt;Really ...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 17 Jun 2002 22:37:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2746590#M892707</guid>
      <dc:creator>Nabil_2</dc:creator>
      <dc:date>2002-06-17T22:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: sed ????</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2746591#M892708</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;To perform tasks on multiple hosts&lt;BR /&gt;&lt;BR /&gt;for eg - to list resolv.conf file on a number of hosts - presuming you have .rhosts setup&lt;BR /&gt;&lt;BR /&gt;Have a file containing the hostnames /tmp/hostnames&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;LOG=/tmp/resolv.log&lt;BR /&gt;HOSTS=/tmp/hostnames&lt;BR /&gt;&lt;BR /&gt;for file in $(cat $HOSTS)&lt;BR /&gt;do&lt;BR /&gt;echo $file &amp;gt;&amp;gt; $LOG&lt;BR /&gt;remsh $file -n 'll /etc/resolv.conf' &amp;gt;&amp;gt; $LOG 2&amp;gt;&amp;amp;1&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Manipulate the above to do what you like&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Steve&lt;BR /&gt;</description>
      <pubDate>Mon, 17 Jun 2002 22:43:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2746591#M892708</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2002-06-17T22:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: sed ????</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2746592#M892709</link>
      <description>Assigning points..Sorry I misunderstood...&lt;BR /&gt;&lt;BR /&gt;Now I know..I just went head and did..&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 17 Jun 2002 22:55:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2746592#M892709</guid>
      <dc:creator>Nabil_2</dc:creator>
      <dc:date>2002-06-17T22:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: sed ????</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2746593#M892710</link>
      <description>Nabil,&lt;BR /&gt;&lt;BR /&gt;I like Clay's use of the perl syntax.&lt;BR /&gt;&lt;BR /&gt;You can also use ed rather than sed:&lt;BR /&gt;&lt;BR /&gt;ed filename &amp;lt;&amp;lt; EOF&lt;BR /&gt;g/rsh/s/rsh/remsh/&lt;BR /&gt;w&lt;BR /&gt;q&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;Joseph.</description>
      <pubDate>Wed, 19 Jun 2002 09:32:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2746593#M892710</guid>
      <dc:creator>Joseph A Benaiah_1</dc:creator>
      <dc:date>2002-06-19T09:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: sed ????</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2746594#M892711</link>
      <description>Hi,&lt;BR /&gt;Sorry I did not get back for feedback soon...I have been kind of busy...&lt;BR /&gt;&lt;BR /&gt;Just a feedback ..I have used Clay's method ..It worked really welll ...&lt;BR /&gt;Thanks Clay for the help and thank you all for your contributions...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 11 Jul 2002 22:26:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2746594#M892711</guid>
      <dc:creator>Nabil_2</dc:creator>
      <dc:date>2002-07-11T22:26:40Z</dc:date>
    </item>
  </channel>
</rss>

