<?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 Need script help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/need-script-help/m-p/2922314#M109809</link>
    <description>I know what I want to do but not sure how to make it happen.  Trying to write a script that will identify bad links.  I'm sure there is some simple solution.  Yes, quite a novice in this realm.  This is actually my first post.&lt;BR /&gt;&lt;BR /&gt;Step 1)&lt;BR /&gt;find /fntst2 -type l -exec ll -d {} \; &amp;gt;/tmplnk&lt;BR /&gt;(this locates my link and puts them out to a temporary file)&lt;BR /&gt;&lt;BR /&gt;Step 2) I want to search this file and print out all of the lines that DO NOT match my search criteria...the bad links. How do I search this temporary file for multiple strings?  i.e. - vgx001, vgx002, vgx003 and then print out the lines that do not match.&lt;BR /&gt;&lt;BR /&gt;I know I could do a grep -v vgx001 file but that would pull up my valid links as well.  Any help is greatly appreciated.</description>
    <pubDate>Fri, 07 Mar 2003 17:42:21 GMT</pubDate>
    <dc:creator>Roy Schauwecker</dc:creator>
    <dc:date>2003-03-07T17:42:21Z</dc:date>
    <item>
      <title>Need script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-script-help/m-p/2922314#M109809</link>
      <description>I know what I want to do but not sure how to make it happen.  Trying to write a script that will identify bad links.  I'm sure there is some simple solution.  Yes, quite a novice in this realm.  This is actually my first post.&lt;BR /&gt;&lt;BR /&gt;Step 1)&lt;BR /&gt;find /fntst2 -type l -exec ll -d {} \; &amp;gt;/tmplnk&lt;BR /&gt;(this locates my link and puts them out to a temporary file)&lt;BR /&gt;&lt;BR /&gt;Step 2) I want to search this file and print out all of the lines that DO NOT match my search criteria...the bad links. How do I search this temporary file for multiple strings?  i.e. - vgx001, vgx002, vgx003 and then print out the lines that do not match.&lt;BR /&gt;&lt;BR /&gt;I know I could do a grep -v vgx001 file but that would pull up my valid links as well.  Any help is greatly appreciated.</description>
      <pubDate>Fri, 07 Mar 2003 17:42:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-script-help/m-p/2922314#M109809</guid>
      <dc:creator>Roy Schauwecker</dc:creator>
      <dc:date>2003-03-07T17:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: Need script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-script-help/m-p/2922315#M109810</link>
      <description>If you're looking for specific names then you could use grep...&lt;BR /&gt;&lt;BR /&gt;find /fntst2 -type l -exec ll -d {} \; | grep -e name1 -e name2 -e name3&lt;BR /&gt;&lt;BR /&gt;Or you could use file instead of ll to identify links that point nowhere...&lt;BR /&gt;&lt;BR /&gt;find /fntst -type l -exec file {} \; | grep "cannot open"&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;John</description>
      <pubDate>Fri, 07 Mar 2003 17:53:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-script-help/m-p/2922315#M109810</guid>
      <dc:creator>John Palmer</dc:creator>
      <dc:date>2003-03-07T17:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Need script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-script-help/m-p/2922316#M109811</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;grep -vE 'vgx001|vgx002|vgx003' file&lt;BR /&gt;&lt;BR /&gt;should print out the non-matching lines for you.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Fri, 07 Mar 2003 17:55:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-script-help/m-p/2922316#M109811</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2003-03-07T17:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: Need script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-script-help/m-p/2922317#M109812</link>
      <description>Thanks. I'll use your idea of searching for the links that point to nothing. I'm actually interested in identifying links that are pointing to the wrong location...a volume group that they should not be pointing to.  We have had some issues with this lately.  What I want to do is plug in the valid volume groups  and any line that doesn't match my list would be printed out to the teminal.</description>
      <pubDate>Fri, 07 Mar 2003 18:01:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-script-help/m-p/2922317#M109812</guid>
      <dc:creator>Roy Schauwecker</dc:creator>
      <dc:date>2003-03-07T18:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: Need script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-script-help/m-p/2922318#M109813</link>
      <description>Roy,&lt;BR /&gt;&lt;BR /&gt;Really!!  Try the grep -v!!!  That's exactly what it does!!!!  Print out the non-matches!!!!!&lt;BR /&gt;&lt;BR /&gt;Trust me!&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Fri, 07 Mar 2003 18:03:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-script-help/m-p/2922318#M109813</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2003-03-07T18:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-script-help/m-p/2922319#M109814</link>
      <description>Excuse my ignorance. The grep -e will actually exclude the lines that contain the search strings and print out the lines that are not a match?</description>
      <pubDate>Fri, 07 Mar 2003 18:13:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-script-help/m-p/2922319#M109814</guid>
      <dc:creator>Roy Schauwecker</dc:creator>
      <dc:date>2003-03-07T18:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Need script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-script-help/m-p/2922320#M109815</link>
      <description>No, it's the grep -v that prints the non-matching lines, the E just allows the extended regular expression syntax.  It's like what John was doing with multiple -e operands.&lt;BR /&gt;&lt;BR /&gt;But it's -v you want - that will print the non match.  From man grep:&lt;BR /&gt;&lt;BR /&gt;"        -v                  All lines but those matching are printed."&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete&lt;BR /&gt;</description>
      <pubDate>Fri, 07 Mar 2003 18:17:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-script-help/m-p/2922320#M109815</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2003-03-07T18:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: Need script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-script-help/m-p/2922321#M109816</link>
      <description>Thanks to John and Pete you have both been a great help.  I'm new to this site and these forums.  What a great source of information.&lt;BR /&gt;&lt;BR /&gt;Im using John's suggestion to locate bad links and Pete's suggestion to locate improperly allocated links.</description>
      <pubDate>Fri, 07 Mar 2003 18:47:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-script-help/m-p/2922321#M109816</guid>
      <dc:creator>Roy Schauwecker</dc:creator>
      <dc:date>2003-03-07T18:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: Need script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-script-help/m-p/2922322#M109817</link>
      <description>find /fmtst2 -type -l -print | perl -nle '-e || print' | while read a&lt;BR /&gt;do&lt;BR /&gt;rm $a&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;(* Can't test right now. :-( *)&lt;BR /&gt;</description>
      <pubDate>Sat, 08 Mar 2003 01:56:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-script-help/m-p/2922322#M109817</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2003-03-08T01:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-script-help/m-p/2922323#M109818</link>
      <description>Note:  This will remove bad symbollic links: (* I believe *)&lt;BR /&gt;&lt;BR /&gt;find /fmtst2 -type -l -print | perl -nle '-e || print' | while read a &lt;BR /&gt;do &lt;BR /&gt;rm $a &lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;Note:  This will just find them. (* TESTED *)&lt;BR /&gt;&lt;BR /&gt;find /fmtst2 -type -l -print | perl -nle '-e || print' &amp;gt; /tmp/file</description>
      <pubDate>Sat, 08 Mar 2003 02:00:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-script-help/m-p/2922323#M109818</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2003-03-08T02:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: Need script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-script-help/m-p/2922324#M109819</link>
      <description>&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;# search and destroy broken&lt;BR /&gt;# symlinks in current dir.&lt;BR /&gt;find . -type l -xdev | while read link junk&lt;BR /&gt;do&lt;BR /&gt;[ -e "$link" ] || rm $link&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 09 Mar 2003 23:38:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-script-help/m-p/2922324#M109819</guid>
      <dc:creator>Jordan Bean</dc:creator>
      <dc:date>2003-03-09T23:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Need script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-script-help/m-p/2922325#M109820</link>
      <description>Probably more efficient to do this if you have hundreds of links to remove.&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;# search and destroy broken&lt;BR /&gt;# symlinks in current dir.&lt;BR /&gt;find . -type l -xdev | while read link&lt;BR /&gt;do&lt;BR /&gt;[ -e "$link" ] || echo \"$link\"&lt;BR /&gt;done | xargs rm&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The quotes should account for any whitespaces in the file names.</description>
      <pubDate>Mon, 10 Mar 2003 20:23:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-script-help/m-p/2922325#M109820</guid>
      <dc:creator>Jordan Bean</dc:creator>
      <dc:date>2003-03-10T20:23:04Z</dc:date>
    </item>
  </channel>
</rss>

