<?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: Inline &amp;quot;Sed&amp;quot; script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/inline-quot-sed-quot-script/m-p/3444528#M851533</link>
    <description>"perl" can do that and more-&lt;BR /&gt; &lt;BR /&gt;perl -p -i -e 's/this/that/g' allmyfiles/*&lt;BR /&gt; &lt;BR /&gt;Will replace the text in all the files under directory allmyfiles.&lt;BR /&gt; &lt;BR /&gt;Change option -i to -i.bu and it will save a backup of each file with an extenstion of .bu.&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
    <pubDate>Wed, 15 Dec 2004 13:23:48 GMT</pubDate>
    <dc:creator>Rodney Hills</dc:creator>
    <dc:date>2004-12-15T13:23:48Z</dc:date>
    <item>
      <title>Inline "Sed" script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/inline-quot-sed-quot-script/m-p/3444525#M851530</link>
      <description>Howdy.&lt;BR /&gt;&lt;BR /&gt;Years ago I had a script that essentially did inline sed on files.&lt;BR /&gt;&lt;BR /&gt;With it you'd call the script and give the sed command, it would then run against the file(s) you specify and do the sed and save the file.&lt;BR /&gt;&lt;BR /&gt;Does anyone have something like this that they'd be willing to post?&lt;BR /&gt;&lt;BR /&gt;TIA.&lt;BR /&gt;&lt;BR /&gt;Sean&lt;BR /&gt;</description>
      <pubDate>Wed, 15 Dec 2004 13:12:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/inline-quot-sed-quot-script/m-p/3444525#M851530</guid>
      <dc:creator>Sean OB_1</dc:creator>
      <dc:date>2004-12-15T13:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: Inline "Sed" script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/inline-quot-sed-quot-script/m-p/3444526#M851531</link>
      <description>Hi Sean,&lt;BR /&gt;&lt;BR /&gt;Is this what you are looking for.&lt;BR /&gt;&lt;BR /&gt;sed one-liner&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.student.northpark.edu/pemente/sed/sed1line.txt" target="_blank"&gt;http://www.student.northpark.edu/pemente/sed/sed1line.txt&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Regds&lt;BR /&gt;</description>
      <pubDate>Wed, 15 Dec 2004 13:17:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/inline-quot-sed-quot-script/m-p/3444526#M851531</guid>
      <dc:creator>Sanjay_6</dc:creator>
      <dc:date>2004-12-15T13:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: Inline "Sed" script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/inline-quot-sed-quot-script/m-p/3444527#M851532</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Here is something using awk,&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.student.northpark.edu/pemente/awk/awk1line.txt" target="_blank"&gt;http://www.student.northpark.edu/pemente/awk/awk1line.txt&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.sap-basis-abap.com/unix/awk-one-liner-tips.htm" target="_blank"&gt;http://www.sap-basis-abap.com/unix/awk-one-liner-tips.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Regds&lt;BR /&gt;</description>
      <pubDate>Wed, 15 Dec 2004 13:19:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/inline-quot-sed-quot-script/m-p/3444527#M851532</guid>
      <dc:creator>Sanjay_6</dc:creator>
      <dc:date>2004-12-15T13:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: Inline "Sed" script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/inline-quot-sed-quot-script/m-p/3444528#M851533</link>
      <description>"perl" can do that and more-&lt;BR /&gt; &lt;BR /&gt;perl -p -i -e 's/this/that/g' allmyfiles/*&lt;BR /&gt; &lt;BR /&gt;Will replace the text in all the files under directory allmyfiles.&lt;BR /&gt; &lt;BR /&gt;Change option -i to -i.bu and it will save a backup of each file with an extenstion of .bu.&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Wed, 15 Dec 2004 13:23:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/inline-quot-sed-quot-script/m-p/3444528#M851533</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2004-12-15T13:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: Inline "Sed" script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/inline-quot-sed-quot-script/m-p/3444529#M851534</link>
      <description>Try this&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;TMF=/tmp/$$&lt;BR /&gt;PRGN=$(basename $0)&lt;BR /&gt;if [ $# -ne 3 ]; then&lt;BR /&gt;  echo "$PRGN:USAGE  $PRGN FILENAME CURR CHANGE"&lt;BR /&gt;  exit&lt;BR /&gt;fi&lt;BR /&gt;if [ -s $1 ];then&lt;BR /&gt;  cat $1| sed "s?$2?$3?g" &amp;gt; $TMF&lt;BR /&gt;  if ! diff $1 $TMF 1&amp;gt;/dev/null ;then&lt;BR /&gt;    cp $TMF $1&lt;BR /&gt;  fi&lt;BR /&gt;else&lt;BR /&gt;  echo "$PRGN:File $1 NOT FOUND"&lt;BR /&gt;fi&lt;BR /&gt;rm $TMF</description>
      <pubDate>Wed, 15 Dec 2004 13:23:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/inline-quot-sed-quot-script/m-p/3444529#M851534</guid>
      <dc:creator>Victor Fridyev</dc:creator>
      <dc:date>2004-12-15T13:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: Inline "Sed" script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/inline-quot-sed-quot-script/m-p/3444530#M851535</link>
      <description>##&lt;BR /&gt;#       sed_files.ksh                                           SDA  12/16/03&lt;BR /&gt;#&lt;BR /&gt;#       Change a string in a file and recreate the file with:&lt;BR /&gt;#&lt;BR /&gt;#               string1 -&amp;gt; string2&lt;BR /&gt;#&lt;BR /&gt;        USAGE="Usage: sed_files.ksh &lt;STRING1&gt; &lt;STRING2&gt; [FILE]"&lt;BR /&gt;#&lt;BR /&gt;#       Example:&lt;BR /&gt;#               sed_files.ksh OLD NEW *.ksh&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;if (( $# &amp;lt; 3 ))&lt;BR /&gt;then&lt;BR /&gt;        print $USAGE&lt;BR /&gt;        exit 1&lt;BR /&gt;fi&lt;BR /&gt;OLD=$1&lt;BR /&gt;NEW=$2&lt;BR /&gt;shift 2&lt;BR /&gt;#&lt;BR /&gt;for F in $*&lt;BR /&gt;do&lt;BR /&gt;        if [[ -f $F ]]&lt;BR /&gt;        then&lt;BR /&gt;                #  We have a regular file&lt;BR /&gt;                file $F | grep -q text&lt;BR /&gt;                if (( $? == 0 ))&lt;BR /&gt;                then&lt;BR /&gt;                        #  We have a text file&lt;BR /&gt;                        grep -q $OLD $F&lt;BR /&gt;                        if (( $? == 0 ))&lt;BR /&gt;                        then&lt;BR /&gt;                                #  We have a text file with "string1" in it&lt;BR /&gt;                                cp -p $F $F.old&lt;BR /&gt;                                sed "s/$OLD/$NEW/g" $F &amp;gt; $F.new&lt;BR /&gt;                                mv $F.new $F&lt;BR /&gt;                                rm $F.old&lt;BR /&gt;                        fi&lt;BR /&gt;                fi&lt;BR /&gt;        fi&lt;BR /&gt;done&lt;BR /&gt;&lt;/STRING2&gt;&lt;/STRING1&gt;</description>
      <pubDate>Wed, 15 Dec 2004 16:20:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/inline-quot-sed-quot-script/m-p/3444530#M851535</guid>
      <dc:creator>Stuart Abramson</dc:creator>
      <dc:date>2004-12-15T16:20:51Z</dc:date>
    </item>
  </channel>
</rss>

