<?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: Scrip saving time in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scrip-saving-time/m-p/3471378#M704199</link>
    <description>&lt;BR /&gt;&lt;BR /&gt;If the status is in a file "x" then you can use a perl '-one liner' like:&lt;BR /&gt;&lt;BR /&gt;perl -ne 'if (/comport\/\s+(\d+)\/(\d+).*SOFTBLOCK/) {system "tappman -vps$1 -p $2 stop";system "tappman -vps$1 -p $2 start"}' x&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Or you can just have perl do it all (untested!):&lt;BR /&gt;&lt;BR /&gt;perl restart.pl&lt;BR /&gt;&lt;BR /&gt;with&lt;BR /&gt;&lt;BR /&gt;------------- restart.pl ------------&lt;BR /&gt;&lt;BR /&gt;foreach (`status cic * * state`) {&lt;BR /&gt;if (/comport\/\s+(\d+)\/(\d+).*SOFTBLOCK/) { system "tappman -vps$1 -p $2 stop";&lt;BR /&gt;system "tappman -vps$1 -p $2 start";&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Broken down:&lt;BR /&gt;- pick up each line from status command into default string $_&lt;BR /&gt;- if you see 'comport' followed by a slash (\/), followed by some whitespace (\s+), followed by some decimals (\d+) remember those in $1 (()) followed by an other slash and some decimals remembers in $2 followed by anything (.*) and 'SOFTBLOCK' ... then&lt;BR /&gt;- execute a stop and a start &lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
    <pubDate>Wed, 26 Jan 2005 10:21:46 GMT</pubDate>
    <dc:creator>Hein van den Heuvel</dc:creator>
    <dc:date>2005-01-26T10:21:46Z</dc:date>
    <item>
      <title>Scrip saving time</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scrip-saving-time/m-p/3471373#M704194</link>
      <description>Hello all,&lt;BR /&gt;&lt;BR /&gt;In my daily work I have to run some commands UX to check some lines status if they are in state SOFTBLOCK i have to spo and start it as is shown in file attached.&lt;BR /&gt;&lt;BR /&gt;Could anyone help me with that to create a script to run the command UI than in a different environment giving the command STATUS CIC * * STATE  according the printout we decide with line to stop and start.&lt;BR /&gt;than to close the environment with Q.&lt;BR /&gt;&lt;BR /&gt;See file attached</description>
      <pubDate>Wed, 26 Jan 2005 08:24:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scrip-saving-time/m-p/3471373#M704194</guid>
      <dc:creator>Taulant Shamo</dc:creator>
      <dc:date>2005-01-26T08:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Scrip saving time</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scrip-saving-time/m-p/3471374#M704195</link>
      <description>Taulant,&lt;BR /&gt;something along these lines:&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;# Run the ui and stream the input&lt;BR /&gt;ui &amp;lt;&amp;lt; .eof &amp;gt; /tmp/$$&lt;BR /&gt;status cic ** state&lt;BR /&gt;q&lt;BR /&gt;.eof&lt;BR /&gt;# Look for the Softblocks&lt;BR /&gt;cat /tmp/$$ | grep -e"SOFTBLOCK" &amp;gt; /tmp/$$_2&lt;BR /&gt;rm /tmp/$$&lt;BR /&gt;# If file exists and softblocks were found&lt;BR /&gt;if [ -s /tmp/$$_2 ]&lt;BR /&gt;then&lt;BR /&gt;tappman -vps2 -p 33 stop&lt;BR /&gt;tappman -vps2 -p 33 start&lt;BR /&gt;else&lt;BR /&gt;echo "No Softblocks found"&lt;BR /&gt;fi&lt;BR /&gt;rm /tmp/$$&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Wed, 26 Jan 2005 08:36:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scrip-saving-time/m-p/3471374#M704195</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2005-01-26T08:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: Scrip saving time</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scrip-saving-time/m-p/3471375#M704196</link>
      <description>numbers 2 and 33 are variables. The alarm my affeck other lines example: 1 15 ore mre that one&lt;BR /&gt;&lt;BR /&gt;tappman -vps2 -p 33 stop&lt;BR /&gt;tappman -vps2 -p 33 start</description>
      <pubDate>Wed, 26 Jan 2005 08:42:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scrip-saving-time/m-p/3471375#M704196</guid>
      <dc:creator>Taulant Shamo</dc:creator>
      <dc:date>2005-01-26T08:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: Scrip saving time</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scrip-saving-time/m-p/3471376#M704197</link>
      <description>#!/usr/bin/sh&lt;BR /&gt;ui &amp;lt;&amp;lt; .eof &amp;gt; /tmp/$$&lt;BR /&gt;status cic ** state&lt;BR /&gt;q&lt;BR /&gt;.eof&lt;BR /&gt;cat $file | grep -e"SOFTBLOCK" &amp;gt; /tmp/$$_2&lt;BR /&gt;if [ -s /tmp/$$_2 ]&lt;BR /&gt;then&lt;BR /&gt;# Assumptions&lt;BR /&gt;# Output is fixed format&lt;BR /&gt;# vps? where ? 0-9&lt;BR /&gt;# p ?? where ?? 00-99&lt;BR /&gt;proc=`cat /tmp/$$_2 | cut -c38`&lt;BR /&gt;ident=`cat /tmp/$$_2 | cut -c40-41`&lt;BR /&gt;tappman -vps$proc -p $ident stop&lt;BR /&gt;tappman -vps$proc -p $ident start&lt;BR /&gt;else&lt;BR /&gt;echo "No Softblocks found"&lt;BR /&gt;fi&lt;BR /&gt;rm /tmp/$$_2&lt;BR /&gt;exit&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Jan 2005 08:50:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scrip-saving-time/m-p/3471376#M704197</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2005-01-26T08:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: Scrip saving time</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scrip-saving-time/m-p/3471377#M704198</link>
      <description>Third time I'll get it right:&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;# This will allow for multiple entries&lt;BR /&gt;ui &amp;lt;&amp;lt; .eof &amp;gt; /tmp/$$&lt;BR /&gt;status cic ** state&lt;BR /&gt;q&lt;BR /&gt;.eof&lt;BR /&gt;cat /tmp/$$ | grep -e"SOFTBLOCK" &amp;gt; /tmp/$$_2&lt;BR /&gt;rm /tmp/$$&lt;BR /&gt;while read record&lt;BR /&gt;do&lt;BR /&gt;part1=`echo $record | awk -F')' '{print $2}'`&lt;BR /&gt;part2=`echo $part1 | awk -F' ' '{print $2}'`&lt;BR /&gt;proc=`echo $part2 | awk -F'/' '{print $1}'`&lt;BR /&gt;ident=`echo $part2 | awk -F'/' '{print $2}'`&lt;BR /&gt;tappman -vps$proc -p $ident stop&lt;BR /&gt;tappman -vps$proc -p $ident start&lt;BR /&gt;done &amp;lt; /tmp/$$_2&lt;BR /&gt;rm /tmp/$$_2&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;Please let us know if this solved the problem&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Jan 2005 09:20:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scrip-saving-time/m-p/3471377#M704198</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2005-01-26T09:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: Scrip saving time</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scrip-saving-time/m-p/3471378#M704199</link>
      <description>&lt;BR /&gt;&lt;BR /&gt;If the status is in a file "x" then you can use a perl '-one liner' like:&lt;BR /&gt;&lt;BR /&gt;perl -ne 'if (/comport\/\s+(\d+)\/(\d+).*SOFTBLOCK/) {system "tappman -vps$1 -p $2 stop";system "tappman -vps$1 -p $2 start"}' x&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Or you can just have perl do it all (untested!):&lt;BR /&gt;&lt;BR /&gt;perl restart.pl&lt;BR /&gt;&lt;BR /&gt;with&lt;BR /&gt;&lt;BR /&gt;------------- restart.pl ------------&lt;BR /&gt;&lt;BR /&gt;foreach (`status cic * * state`) {&lt;BR /&gt;if (/comport\/\s+(\d+)\/(\d+).*SOFTBLOCK/) { system "tappman -vps$1 -p $2 stop";&lt;BR /&gt;system "tappman -vps$1 -p $2 start";&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Broken down:&lt;BR /&gt;- pick up each line from status command into default string $_&lt;BR /&gt;- if you see 'comport' followed by a slash (\/), followed by some whitespace (\s+), followed by some decimals (\d+) remember those in $1 (()) followed by an other slash and some decimals remembers in $2 followed by anything (.*) and 'SOFTBLOCK' ... then&lt;BR /&gt;- execute a stop and a start &lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Jan 2005 10:21:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scrip-saving-time/m-p/3471378#M704199</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2005-01-26T10:21:46Z</dc:date>
    </item>
  </channel>
</rss>

