<?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 Update content in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/update-content/m-p/3361659#M194169</link>
    <description>IF I have a file , the file content is as below , there are so many word "abc" , I want to change all these word to another word "def" , except change it manually , what can I do ? thx.&lt;BR /&gt;&lt;BR /&gt;# vi abc.txt&lt;BR /&gt;..abc....&lt;BR /&gt;.abc.....&lt;BR /&gt;...abc..&lt;BR /&gt;....abc.&lt;BR /&gt;"&lt;BR /&gt;"</description>
    <pubDate>Fri, 20 Aug 2004 01:01:53 GMT</pubDate>
    <dc:creator>peterchu</dc:creator>
    <dc:date>2004-08-20T01:01:53Z</dc:date>
    <item>
      <title>Update content</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/update-content/m-p/3361659#M194169</link>
      <description>IF I have a file , the file content is as below , there are so many word "abc" , I want to change all these word to another word "def" , except change it manually , what can I do ? thx.&lt;BR /&gt;&lt;BR /&gt;# vi abc.txt&lt;BR /&gt;..abc....&lt;BR /&gt;.abc.....&lt;BR /&gt;...abc..&lt;BR /&gt;....abc.&lt;BR /&gt;"&lt;BR /&gt;"</description>
      <pubDate>Fri, 20 Aug 2004 01:01:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/update-content/m-p/3361659#M194169</guid>
      <dc:creator>peterchu</dc:creator>
      <dc:date>2004-08-20T01:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: Update content</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/update-content/m-p/3361660#M194170</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;sed -e 's/abc/def/g' abc.txt &amp;gt; abc_new.txt</description>
      <pubDate>Fri, 20 Aug 2004 01:09:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/update-content/m-p/3361660#M194170</guid>
      <dc:creator>Slawomir Gora</dc:creator>
      <dc:date>2004-08-20T01:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: Update content</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/update-content/m-p/3361661#M194171</link>
      <description>thx Gola's reply,&lt;BR /&gt;&lt;BR /&gt;I have one more requirement , if I want to update all files under a directory ( not only abc.txt , eg , all file under /home ) , what can I do ? thx.</description>
      <pubDate>Fri, 20 Aug 2004 01:20:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/update-content/m-p/3361661#M194171</guid>
      <dc:creator>peterchu</dc:creator>
      <dc:date>2004-08-20T01:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: Update content</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/update-content/m-p/3361662#M194172</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;ex.&lt;BR /&gt;&lt;BR /&gt;cd /home&lt;BR /&gt;for f in `ls`&lt;BR /&gt;do&lt;BR /&gt;  mv $f $f.tmp&lt;BR /&gt;  sed -e 's/def/def/g' $f.tmp &amp;gt; $f&lt;BR /&gt;  rm $f.tmp&lt;BR /&gt;done&lt;BR /&gt;</description>
      <pubDate>Fri, 20 Aug 2004 01:31:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/update-content/m-p/3361662#M194172</guid>
      <dc:creator>Slawomir Gora</dc:creator>
      <dc:date>2004-08-20T01:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Update content</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/update-content/m-p/3361663#M194173</link>
      <description>You can do this through vi as well:&lt;BR /&gt;&lt;BR /&gt;vi file&lt;BR /&gt;Press Esc&lt;BR /&gt;&lt;BR /&gt;:1,$  s/abc/def/g&lt;BR /&gt;:wq!&lt;BR /&gt;&lt;BR /&gt;sks</description>
      <pubDate>Fri, 20 Aug 2004 01:37:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/update-content/m-p/3361663#M194173</guid>
      <dc:creator>Sanjay Kumar Suri</dc:creator>
      <dc:date>2004-08-20T01:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: Update content</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/update-content/m-p/3361664#M194174</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;more correct version :)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;cd put_dir&lt;BR /&gt;&lt;BR /&gt;for f in `ls`&lt;BR /&gt;do&lt;BR /&gt;  if  [ -d $f ]&lt;BR /&gt;  then&lt;BR /&gt;    echo "$f -&amp;gt; directory"&lt;BR /&gt;  else&lt;BR /&gt;    mv $f $f.tmp&lt;BR /&gt;    sed -e 's/def/def/g' $f.tmp &amp;gt; $f&lt;BR /&gt;    rm $f.tmp&lt;BR /&gt;  fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 20 Aug 2004 01:37:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/update-content/m-p/3361664#M194174</guid>
      <dc:creator>Slawomir Gora</dc:creator>
      <dc:date>2004-08-20T01:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: Update content</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/update-content/m-p/3361665#M194175</link>
      <description>thx Gora again,&lt;BR /&gt;&lt;BR /&gt;your method seems too complicate for me , can I use "find" to do it ? thx.</description>
      <pubDate>Fri, 20 Aug 2004 01:42:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/update-content/m-p/3361665#M194175</guid>
      <dc:creator>peterchu</dc:creator>
      <dc:date>2004-08-20T01:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: Update content</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/update-content/m-p/3361666#M194176</link>
      <description>I put this together for you.  I hope it helps.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;count=1&lt;BR /&gt;for files in `ls -1 *.txt`&lt;BR /&gt;do&lt;BR /&gt;count=`expr $count + 1`&lt;BR /&gt;echo $count&lt;BR /&gt;sed -e 's/abc/def/g' $files &amp;gt; abc_new${count}.txt&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;-Brian.</description>
      <pubDate>Fri, 20 Aug 2004 01:54:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/update-content/m-p/3361666#M194176</guid>
      <dc:creator>Brian Markus</dc:creator>
      <dc:date>2004-08-20T01:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: Update content</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/update-content/m-p/3361667#M194177</link>
      <description>Yet another way with perl&lt;BR /&gt;&lt;BR /&gt;perl -pi.orig -e 's,abc,def,g' *.txt&lt;BR /&gt;&lt;BR /&gt;Original files will be saved with .orig suffix.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 20 Aug 2004 01:58:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/update-content/m-p/3361667#M194177</guid>
      <dc:creator>Ermin Borovac</dc:creator>
      <dc:date>2004-08-20T01:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: Update content</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/update-content/m-p/3361668#M194178</link>
      <description>thx all replies,&lt;BR /&gt;&lt;BR /&gt;As my above post , if I want to update all files under a directory (  , eg , all files under the directory /home , not only abc.txt ) , what can I do ? thx</description>
      <pubDate>Fri, 20 Aug 2004 02:59:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/update-content/m-p/3361668#M194178</guid>
      <dc:creator>peterchu</dc:creator>
      <dc:date>2004-08-20T02:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: Update content</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/update-content/m-p/3361669#M194179</link>
      <description>Use can use Brian script with following change.&lt;BR /&gt;&lt;BR /&gt;cd /home&lt;BR /&gt;mkdir /home/temp&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;count=1&lt;BR /&gt;for files in `ls`&lt;BR /&gt;do&lt;BR /&gt;count=`expr $count + 1`&lt;BR /&gt;echo $count&lt;BR /&gt;sed -e 's/abc/def/g' $files &amp;gt; temp/$files&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Then move the file from temp back to /home.&lt;BR /&gt;&lt;BR /&gt;sks</description>
      <pubDate>Fri, 20 Aug 2004 03:14:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/update-content/m-p/3361669#M194179</guid>
      <dc:creator>Sanjay Kumar Suri</dc:creator>
      <dc:date>2004-08-20T03:14:05Z</dc:date>
    </item>
  </channel>
</rss>

