<?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: Script help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2554760#M28575</link>
    <description>Greg,&lt;BR /&gt;&lt;BR /&gt;This works for me, assuming that there is only one keyword POOL.  Also, be warned, everytime you run this it will keep adding the word EJECT after POOL.&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;ed filename &amp;lt;&lt;STOPHERE&gt;&lt;/STOPHERE&gt;/^POOL /&lt;BR /&gt;a&lt;BR /&gt;EJECT&lt;BR /&gt;.&lt;BR /&gt;w&lt;BR /&gt;q&lt;BR /&gt;STOPHERE&lt;BR /&gt;</description>
    <pubDate>Thu, 19 Jul 2001 17:07:50 GMT</pubDate>
    <dc:creator>Scott Robertson</dc:creator>
    <dc:date>2001-07-19T17:07:50Z</dc:date>
    <item>
      <title>Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2554759#M28574</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I need help with a script that I want to add a line to an existing file in a certain spot.  For instance, take the following file:&lt;BR /&gt;&lt;BR /&gt;NAME "server_DLT"&lt;BR /&gt;DESCRIPTION "server_DLT"&lt;BR /&gt;HOST server.com&lt;BR /&gt;POLICY Standalone&lt;BR /&gt;TYPE DLT&lt;BR /&gt;POOL "server_DLT"&lt;BR /&gt;CLEANME&lt;BR /&gt;DRIVES&lt;BR /&gt;        "/dev/rmt1"&lt;BR /&gt;&lt;BR /&gt;and change it to:&lt;BR /&gt;&lt;BR /&gt;NAME "server_DLT"&lt;BR /&gt;DESCRIPTION "server_DLT"&lt;BR /&gt;HOST server.com&lt;BR /&gt;POLICY Standalone&lt;BR /&gt;TYPE DLT&lt;BR /&gt;POOL "server_DLT"&lt;BR /&gt;EJECT&lt;BR /&gt;CLEANME&lt;BR /&gt;DRIVES&lt;BR /&gt;        "/dev/rmt1"&lt;BR /&gt;&lt;BR /&gt;i.e. add the EJECT line after the POOL line.  Any help would be greatly appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance,&lt;BR /&gt;Greg</description>
      <pubDate>Thu, 19 Jul 2001 16:40:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2554759#M28574</guid>
      <dc:creator>Greg Stark_1</dc:creator>
      <dc:date>2001-07-19T16:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2554760#M28575</link>
      <description>Greg,&lt;BR /&gt;&lt;BR /&gt;This works for me, assuming that there is only one keyword POOL.  Also, be warned, everytime you run this it will keep adding the word EJECT after POOL.&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;ed filename &amp;lt;&lt;STOPHERE&gt;&lt;/STOPHERE&gt;/^POOL /&lt;BR /&gt;a&lt;BR /&gt;EJECT&lt;BR /&gt;.&lt;BR /&gt;w&lt;BR /&gt;q&lt;BR /&gt;STOPHERE&lt;BR /&gt;</description>
      <pubDate>Thu, 19 Jul 2001 17:07:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2554760#M28575</guid>
      <dc:creator>Scott Robertson</dc:creator>
      <dc:date>2001-07-19T17:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2554761#M28576</link>
      <description>From perl you can do the following&lt;BR /&gt;&lt;BR /&gt; perl -n -i -e 'print $_; print "EJECT\n" if /^POOL/' yourscriptfile&lt;BR /&gt;&lt;BR /&gt;This will process the file and add EJECT after the line beginning with POOL</description>
      <pubDate>Thu, 19 Jul 2001 17:09:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2554761#M28576</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2001-07-19T17:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2554762#M28577</link>
      <description>Or just use sed:&lt;BR /&gt;&lt;BR /&gt;sed '/CLEANME/iEJECT' copyoffile &amp;gt; filename</description>
      <pubDate>Thu, 19 Jul 2001 17:11:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2554762#M28577</guid>
      <dc:creator>Bernie Vande Griend</dc:creator>
      <dc:date>2001-07-19T17:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2554763#M28578</link>
      <description>hmm, looks like it takes out backslashes.&lt;BR /&gt;There should be a backslash after the /i&lt;BR /&gt;and CHANGE should be on the next line.</description>
      <pubDate>Thu, 19 Jul 2001 17:13:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2554763#M28578</guid>
      <dc:creator>Bernie Vande Griend</dc:creator>
      <dc:date>2001-07-19T17:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2554764#M28579</link>
      <description>Hi Greg:&lt;BR /&gt;&lt;BR /&gt;Here's how I would do this:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;echo "/POOL/a\\\\\nEJECT" &amp;gt; /tmp/sed.cmd&lt;BR /&gt;sed -f /tmp/sed.cmd /tmp/inp &amp;gt; /tmp/out&lt;BR /&gt;mv /tmp/out /tmp/inp&lt;BR /&gt;#.end.&lt;BR /&gt;&lt;BR /&gt;The echo creates a sed script (command) file that looks like this:&lt;BR /&gt;&lt;BR /&gt;/POOL/aEJECT&lt;BR /&gt;&lt;BR /&gt;The 'a' says "append" after the match is made with "POOL".&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 19 Jul 2001 19:19:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2554764#M28579</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-07-19T19:19:37Z</dc:date>
    </item>
  </channel>
</rss>

