<?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: Scrpit help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scrpit-help/m-p/3197178#M165973</link>
    <description>Elmer's sed script is so much cleaner!!!</description>
    <pubDate>Fri, 20 Feb 2004 09:18:40 GMT</pubDate>
    <dc:creator>rmueller58</dc:creator>
    <dc:date>2004-02-20T09:18:40Z</dc:date>
    <item>
      <title>Scrpit help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scrpit-help/m-p/3197171#M165966</link>
      <description>Hello Admins&lt;BR /&gt;&lt;BR /&gt;I am writing a script that does a replace within a series of text files.  The problem that i am having is with the sed portion of it. &lt;BR /&gt;&lt;BR /&gt;The line that I am replacing will always be line 4.  It starts with "startprogram_gui:  "  followed by other text.  I need to replace the other text with "otczsvmsg1"&lt;BR /&gt;&lt;BR /&gt;The problem is that I could use a series of sed commands to do it, but I was hoping that there is a more elegant method.&lt;BR /&gt;&lt;BR /&gt;Any quick ideas?&lt;BR /&gt;&lt;BR /&gt;Good points for all</description>
      <pubDate>Thu, 19 Feb 2004 15:40:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scrpit-help/m-p/3197171#M165966</guid>
      <dc:creator>George C. Abraham_2</dc:creator>
      <dc:date>2004-02-19T15:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: Scrpit help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scrpit-help/m-p/3197172#M165967</link>
      <description>George -&lt;BR /&gt;sed 's/gui.*$/guisomething/' dummy &amp;gt;dummy2&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;dl</description>
      <pubDate>Thu, 19 Feb 2004 15:53:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scrpit-help/m-p/3197172#M165967</guid>
      <dc:creator>Dave La Mar</dc:creator>
      <dc:date>2004-02-19T15:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: Scrpit help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scrpit-help/m-p/3197173#M165968</link>
      <description>Hi,&lt;BR /&gt;try this simple script, using your input file as $1:&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;while read word rest&lt;BR /&gt;do&lt;BR /&gt;        if [ "$word" = "startprogram_gui:" ]&lt;BR /&gt;        then&lt;BR /&gt;                rest="otczsvmsg1"&lt;BR /&gt;        fi&lt;BR /&gt;        echo "$word $rest"&lt;BR /&gt;done &amp;lt;$1&lt;BR /&gt; &lt;BR /&gt;regards,&lt;BR /&gt;John K.</description>
      <pubDate>Thu, 19 Feb 2004 15:54:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scrpit-help/m-p/3197173#M165968</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2004-02-19T15:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: Scrpit help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scrpit-help/m-p/3197174#M165969</link>
      <description>how about just&lt;BR /&gt;&lt;BR /&gt;ex -s -c "4 s/:.*/: otczsvmsg1/|wq" $yourfile</description>
      <pubDate>Thu, 19 Feb 2004 17:20:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scrpit-help/m-p/3197174#M165969</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2004-02-19T17:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: Scrpit help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scrpit-help/m-p/3197175#M165970</link>
      <description># perl -pi -e 's/gui.*$/guisomething/' file1 file2 file3&lt;BR /&gt;&lt;BR /&gt;will IN PLACE make the substitutions in all files passed&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Fri, 20 Feb 2004 02:14:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scrpit-help/m-p/3197175#M165970</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2004-02-20T02:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: Scrpit help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scrpit-help/m-p/3197176#M165971</link>
      <description>You can do it quite simple, just like your description of the problem:&lt;BR /&gt;sed '4s/^startprogram_gui:.*$/startprogram_gui: otczsvmsg1/'&lt;BR /&gt;&lt;BR /&gt;(On line 4, replace the line if it starts with .... to ...)&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 20 Feb 2004 02:34:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scrpit-help/m-p/3197176#M165971</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2004-02-20T02:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: Scrpit help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scrpit-help/m-p/3197177#M165972</link>
      <description>I created a process to insert a piece of text into a the .profile.. to lock people off our system based on subdirectories in the /tmp fs.. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# ========================================================================&lt;BR /&gt;# This script is used for global modifications of all profiles..&lt;BR /&gt;# This is was written to disseminate a test condition to lock accounts&lt;BR /&gt;# prior to backup/export&lt;BR /&gt;# Written by Rex Mueller - Unix Systems Engineer 6/2/2003&lt;BR /&gt;# FILE NAME /pei/peitools/bin/profchange&lt;BR /&gt;# ========================================================================&lt;BR /&gt;#&lt;BR /&gt;# ========================================================================&lt;BR /&gt;# DEFINE GLOBAL VARIABLES&lt;BR /&gt;# ========================================================================&lt;BR /&gt;export SDE=`date +%m%d%Y`&lt;BR /&gt;#echo $SDE&lt;BR /&gt;export STI=`date +%T`&lt;BR /&gt;#echo $STI&lt;BR /&gt;&lt;BR /&gt;A=`cat /etc/passwd|wc -l`&lt;BR /&gt;export A&lt;BR /&gt;B=15&lt;BR /&gt;export B&lt;BR /&gt;C=`expr $A - $B`&lt;BR /&gt;export C&lt;BR /&gt;# ECHO VARIABLES FOR TESTING ONLY!!!&lt;BR /&gt;&lt;BR /&gt;#echo $A&lt;BR /&gt;#echo $B&lt;BR /&gt;#echo $C&lt;BR /&gt;&lt;BR /&gt;tail -n +15 /etc/passwd &amp;gt; /tmp/passwd.tmp&lt;BR /&gt;#tail -n +$B /etc/passwd |more&lt;BR /&gt;&lt;BR /&gt;export prof1=/.profile&lt;BR /&gt;&lt;BR /&gt;# =========================================================================&lt;BR /&gt;# PROGRAM EXECUTION&lt;BR /&gt;# =========================================================================&lt;BR /&gt;#find / -name .profile -print &amp;gt; /tmp/proflist&lt;BR /&gt;for prof in `awk -F":" '{print $6}' /tmp/passwd.tmp`&lt;BR /&gt;do&lt;BR /&gt;# =========================================================================&lt;BR /&gt;# DEFINE LOCAL VARIABLES&lt;BR /&gt;# =========================================================================&lt;BR /&gt;export PROF2=$prof&lt;BR /&gt;echo $PROF2 &amp;gt; /tmp/dirtemp&lt;BR /&gt;#awk -F":" '{print substr( $6, 7, 3)}' /etc/passwd&lt;BR /&gt;awk -F":" '{print substr($1, 7, 3)}' /tmp/dirtemp &amp;gt; /tmp/disttemp&lt;BR /&gt;export dist=`cat /tmp/disttemp`&lt;BR /&gt;#echo $PROF2&lt;BR /&gt;#echo $PROF2$prof1&lt;BR /&gt;#echo $dist&lt;BR /&gt;# =========================================================================&lt;BR /&gt;# PROFILE MODIFICATION PROCESS USING LOCAL VARIABLES&lt;BR /&gt;# =========================================================================&lt;BR /&gt;cp profchange.template prochange.tmp&lt;BR /&gt;perl -p -i -e s/LOCKDIR/$dist"LOCK"/g prochange.tmp&lt;BR /&gt;&lt;BR /&gt;cat $PROF2$prof1 &amp;gt; $PROF2/.profile.$SDE&lt;BR /&gt;cat $PROF2$prof1 &amp;gt;&amp;gt; prochange.tmp&lt;BR /&gt;cat prochange.tmp &amp;gt;&amp;gt; $PROF2$prof1&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;# =========================================================================&lt;BR /&gt;# ESU#3 DATA AND NETWORK PASSWORD EXCEPTION LIST&lt;BR /&gt;# Reverses Profile changes for Administrative and Helpdesk users&lt;BR /&gt;# dsrath, slforslu, dwmilan, glfergus, phillips, rmueller&lt;BR /&gt;# =========================================================================&lt;BR /&gt;cp -p /home/esu/dsrath/.profile.$SDE /home/esu/dsrath/.profile&lt;BR /&gt;cp -p /home/esu/slforslu/.profile.$SDE /home/esu/slforslu/.profile&lt;BR /&gt;cp -p /home/esu/dwmilan/.profile.$SDE /home/esu/dwmilan/.profile&lt;BR /&gt;cp -p /home/esu/glfergus/.profile.$SDE /home/esu/glfergus/.profile&lt;BR /&gt;cp -p /home/esu/phillips/.profile.$SDE /home/esu/phillips/.profile&lt;BR /&gt;cp -p /home/esu/rmueller/.profile.$SDE /home/esu/rmueller/.profile&lt;BR /&gt;&lt;BR /&gt;# =========================================================================&lt;BR /&gt;# PROGRAM DONE!!!&lt;BR /&gt;# =========================================================================&lt;BR /&gt;&lt;BR /&gt;# profile.template &lt;BR /&gt;&lt;BR /&gt;if  [ -d "/tmp/LOCKDIR" ]&lt;BR /&gt;        then&lt;BR /&gt;           cat /etc/motd&lt;BR /&gt;           echo "press any key to continue\n"&lt;BR /&gt;           read&lt;BR /&gt;           exit&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 20 Feb 2004 09:15:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scrpit-help/m-p/3197177#M165972</guid>
      <dc:creator>rmueller58</dc:creator>
      <dc:date>2004-02-20T09:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: Scrpit help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scrpit-help/m-p/3197178#M165973</link>
      <description>Elmer's sed script is so much cleaner!!!</description>
      <pubDate>Fri, 20 Feb 2004 09:18:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scrpit-help/m-p/3197178#M165973</guid>
      <dc:creator>rmueller58</dc:creator>
      <dc:date>2004-02-20T09:18:40Z</dc:date>
    </item>
  </channel>
</rss>

