<?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: shell script to check if patch is installed or not in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-check-if-patch-is-installed-or-not/m-p/3044309#M134985</link>
    <description>Great, glad we could help. How about handing out some points?&lt;BR /&gt;&lt;BR /&gt;BTW, my C coding slipped in by accident. The exit statement should not end in a semi-colin.&lt;BR /&gt;&lt;BR /&gt;exit 1;&lt;BR /&gt;&lt;BR /&gt;Should just be&lt;BR /&gt;&lt;BR /&gt;exit 1</description>
    <pubDate>Thu, 07 Aug 2003 18:02:19 GMT</pubDate>
    <dc:creator>Brian Bergstrand</dc:creator>
    <dc:date>2003-08-07T18:02:19Z</dc:date>
    <item>
      <title>shell script to check if patch is installed or not</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-check-if-patch-is-installed-or-not/m-p/3044302#M134978</link>
      <description>hi&lt;BR /&gt;I need to write a script which checks if a particular patch is installed or not.&lt;BR /&gt;I have written something like&lt;BR /&gt;if grep $input swlist1.out &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;then&lt;BR /&gt;echo "installed"&lt;BR /&gt;else&lt;BR /&gt;echo "not installed"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;The output of swlist command is stored in the file swlist1.out&lt;BR /&gt;&lt;BR /&gt;I'm getting this error.&lt;BR /&gt;ERRNO=25&lt;BR /&gt;LINENO=2&lt;BR /&gt;MAILCHECK=600&lt;BR /&gt;OPTIND=1&lt;BR /&gt;PPID=26004&lt;BR /&gt;RANDOM=24630&lt;BR /&gt;SECONDS=0&lt;BR /&gt;TMOUT=0&lt;BR /&gt; Please enter the name of the application&lt;BR /&gt;perl&lt;BR /&gt;You entered perl&lt;BR /&gt;./hpscript2.ksh[7]: swlist:  not found&lt;BR /&gt;software perl not installed&lt;BR /&gt;&lt;BR /&gt;Please help.</description>
      <pubDate>Thu, 07 Aug 2003 17:14:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-check-if-patch-is-installed-or-not/m-p/3044302#M134978</guid>
      <dc:creator>Adi_7</dc:creator>
      <dc:date>2003-08-07T17:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: shell script to check if patch is installed or not</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-check-if-patch-is-installed-or-not/m-p/3044303#M134979</link>
      <description>Why not just a simple line like:&lt;BR /&gt;&lt;BR /&gt;swlist -l fileset -a state | grep PH&lt;WHATEVER&gt;&lt;BR /&gt;&lt;BR /&gt;This will tell you if it's on the box....and if it's configured or not.&lt;BR /&gt;&lt;BR /&gt;You could output to a file if you want....by just ending with &amp;gt; to-this.file&lt;BR /&gt;&lt;BR /&gt;Just a simple thought,&lt;BR /&gt;Rita&lt;BR /&gt;&lt;/WHATEVER&gt;</description>
      <pubDate>Thu, 07 Aug 2003 17:20:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-check-if-patch-is-installed-or-not/m-p/3044303#M134979</guid>
      <dc:creator>Rita C Workman</dc:creator>
      <dc:date>2003-08-07T17:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: shell script to check if patch is installed or not</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-check-if-patch-is-installed-or-not/m-p/3044304#M134980</link>
      <description>You have an error in your script.&lt;BR /&gt;&lt;BR /&gt;It should be (ignore line wraps):&lt;BR /&gt;&lt;BR /&gt;if [ `grep $input swlist1.out &amp;gt; /dev/null 2&amp;gt;&amp;amp;1` -eq 0 ]; then&lt;BR /&gt;echo "installed" &lt;BR /&gt;else &lt;BR /&gt;echo "not installed" &lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Of course Rita's suggestion is much easier.&lt;BR /&gt;&lt;BR /&gt;HTH.</description>
      <pubDate>Thu, 07 Aug 2003 17:24:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-check-if-patch-is-installed-or-not/m-p/3044304#M134980</guid>
      <dc:creator>Brian Bergstrand</dc:creator>
      <dc:date>2003-08-07T17:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: shell script to check if patch is installed or not</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-check-if-patch-is-installed-or-not/m-p/3044305#M134981</link>
      <description>Hi Rita,&lt;BR /&gt;Thanks for your reply.&lt;BR /&gt;swlist -l fileset -a state | grep PHCO_23083&lt;BR /&gt;This command gives if that patch is installed or not.&lt;BR /&gt;But what if I have to check if a particular software(application) is installed or not?&lt;BR /&gt;&lt;BR /&gt;Thanks again.</description>
      <pubDate>Thu, 07 Aug 2003 17:41:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-check-if-patch-is-installed-or-not/m-p/3044305#M134981</guid>
      <dc:creator>Adi_7</dc:creator>
      <dc:date>2003-08-07T17:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: shell script to check if patch is installed or not</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-check-if-patch-is-installed-or-not/m-p/3044306#M134982</link>
      <description>To grep for an app, just change the arg to grep. For instance to see if CDE is installed.&lt;BR /&gt;&lt;BR /&gt;swlist -l product | grep -i cde&lt;BR /&gt;&lt;BR /&gt;You could generalize this as a shell script if you wanted too.&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;if [ -z "$1" ]; then&lt;BR /&gt;echo "arg needed"&lt;BR /&gt;exit 1;&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;swlist -l product | grep -i "$1"&lt;BR /&gt;&lt;BR /&gt;Save this where you want, make it executable and then run. E.G.&lt;BR /&gt;&lt;BR /&gt;/usr/local/sbin/myswchk.sh CDE&lt;BR /&gt;&lt;BR /&gt;HTH.</description>
      <pubDate>Thu, 07 Aug 2003 17:49:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-check-if-patch-is-installed-or-not/m-p/3044306#M134982</guid>
      <dc:creator>Brian Bergstrand</dc:creator>
      <dc:date>2003-08-07T17:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: shell script to check if patch is installed or not</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-check-if-patch-is-installed-or-not/m-p/3044307#M134983</link>
      <description>Actually I'm trying to write a tiny script that will determine whether a particular software application is installed.  This script should take as its input (either as a command line argument or hard coded) the name of the application.  Its output should be something like "Installed" or "Not Installed".&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 07 Aug 2003 17:49:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-check-if-patch-is-installed-or-not/m-p/3044307#M134983</guid>
      <dc:creator>Adi_7</dc:creator>
      <dc:date>2003-08-07T17:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: shell script to check if patch is installed or not</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-check-if-patch-is-installed-or-not/m-p/3044308#M134984</link>
      <description>hey brian,&lt;BR /&gt;thanks a lot.Your script did work.&lt;BR /&gt;</description>
      <pubDate>Thu, 07 Aug 2003 17:55:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-check-if-patch-is-installed-or-not/m-p/3044308#M134984</guid>
      <dc:creator>Adi_7</dc:creator>
      <dc:date>2003-08-07T17:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: shell script to check if patch is installed or not</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-check-if-patch-is-installed-or-not/m-p/3044309#M134985</link>
      <description>Great, glad we could help. How about handing out some points?&lt;BR /&gt;&lt;BR /&gt;BTW, my C coding slipped in by accident. The exit statement should not end in a semi-colin.&lt;BR /&gt;&lt;BR /&gt;exit 1;&lt;BR /&gt;&lt;BR /&gt;Should just be&lt;BR /&gt;&lt;BR /&gt;exit 1</description>
      <pubDate>Thu, 07 Aug 2003 18:02:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-check-if-patch-is-installed-or-not/m-p/3044309#M134985</guid>
      <dc:creator>Brian Bergstrand</dc:creator>
      <dc:date>2003-08-07T18:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: shell script to check if patch is installed or not</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-check-if-patch-is-installed-or-not/m-p/3044310#M134986</link>
      <description>actually It didnt make any difference.&lt;BR /&gt;But thanks for reminding.</description>
      <pubDate>Thu, 07 Aug 2003 18:11:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-check-if-patch-is-installed-or-not/m-p/3044310#M134986</guid>
      <dc:creator>Adi_7</dc:creator>
      <dc:date>2003-08-07T18:11:37Z</dc:date>
    </item>
  </channel>
</rss>

