<?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: Help with a perl script subroutine... in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/help-with-a-perl-script-subroutine/m-p/3649287#M102402</link>
    <description>This is orignally someone else's subrouting I am attempting to modify to make it fit new demands.&lt;BR /&gt;&lt;BR /&gt;Problem... It's looking at the array results and what it found then attempting to remove the files when they have already been removed; it then complains with errors like the following:&lt;BR /&gt;&lt;BR /&gt;++++++++++++++++++++++++++++++++++++++&lt;BR /&gt;&lt;BR /&gt;/main/obe/TST1/bbb/bint/core.20050928 not found&lt;BR /&gt;/usr/local/bin/sudo: Illegal option -f&lt;BR /&gt;usage: sudo -V | -h | -L | -l | -v | -k | -K | [-H] [-P] [-S] [-b] [-p prompt]&lt;BR /&gt;[-u username/#uid] -s | &lt;COMMAND&gt;&lt;BR /&gt;/main/obe/TST1/bbb/bint/core.20050930 not found&lt;BR /&gt;/usr/local/bin/sudo: Illegal option -f&lt;BR /&gt;usage: sudo -V | -h | -L | -l | -v | -k | -K | [-H] [-P] [-S] [-b] [-p prompt]&lt;BR /&gt;[-u username/#uid] -s | &lt;COMMAND&gt;&lt;BR /&gt;/main/obe/TST1/bbb/bint/core.20050929 not found&lt;BR /&gt;/usr/local/bin/sudo: Illegal option -f&lt;BR /&gt;usage: sudo -V | -h | -L | -l | -v | -k | -K | [-H] [-P] [-S] [-b] [-p prompt]&lt;BR /&gt;[-u username/#uid] -s | &lt;COMMAND&gt;&lt;BR /&gt;/main/obe/TST1/bbb/bint/core.20050926 not found&lt;BR /&gt;/usr/local/bin/sudo: Illegal option -f&lt;BR /&gt;usage: sudo -V | -h | -L | -l | -v | -k | -K | [-H] [-P] [-S] [-b] [-p prompt]&lt;BR /&gt;[-u username/#uid] -s | &lt;COMMAND&gt;&lt;BR /&gt;/main/obe/TST1/bbb/bint/core.20050922 not found&lt;BR /&gt;/usr/local/bin/sudo: Illegal option -f&lt;BR /&gt;usage: sudo -V | -h | -L | -l | -v | -k | -K | [-H] [-P] [-S] [-b] [-p prompt]&lt;BR /&gt;[-u username/#uid] -s | &lt;COMMAND&gt;&lt;BR /&gt;++++++++++++++++++++++++++++++++++++++&lt;BR /&gt;&lt;BR /&gt;This, after the files were actually found, they were there, they were also removed as per the subroutine's params... anyone see the mistake I've made on the modifications I have used?&lt;BR /&gt;&lt;BR /&gt;Thanks for any ideas...&lt;BR /&gt;&lt;BR /&gt;MAD&lt;/COMMAND&gt;&lt;/COMMAND&gt;&lt;/COMMAND&gt;&lt;/COMMAND&gt;&lt;/COMMAND&gt;</description>
    <pubDate>Thu, 13 Oct 2005 21:19:44 GMT</pubDate>
    <dc:creator>MAD_2</dc:creator>
    <dc:date>2005-10-13T21:19:44Z</dc:date>
    <item>
      <title>Help with a perl script subroutine...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-with-a-perl-script-subroutine/m-p/3649286#M102401</link>
      <description>Basically, the code has the attached subroutine.&lt;BR /&gt;&lt;BR /&gt;It's called from the following lines:&lt;BR /&gt;&lt;BR /&gt;#*****************************************&lt;BR /&gt;if ($APPLI_CNT &amp;gt; 0) &lt;BR /&gt;{&lt;BR /&gt;print "................&amp;gt;";&lt;BR /&gt;for ($j = 0; $j &amp;lt; scalar(@LES_APPLI); $j++)&lt;BR /&gt;{&lt;BR /&gt;chomp($LES_APPLI[$j]);&lt;BR /&gt;print "\n&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;App nber ", $j + 1, " is ", uc($LES_APPLI[$j]),"\n";&lt;BR /&gt;for ($t = 0; $t &amp;lt; scalar(@phases) ; $t++)&lt;BR /&gt;{&lt;BR /&gt;if ($LES_APPLI[$j] =~ /aaa|bbb|ccc|ddd/ )&lt;BR /&gt;{&lt;BR /&gt;$newpath = "/main/obe/$phases[$t]/$LES_APPLI[$j]/com/core";&lt;BR /&gt;print "check: $newpath\n";&lt;BR /&gt;new_path "$newpath";&lt;BR /&gt;}&lt;BR /&gt;elsif ($LES_APPLI[$j] =~ /eee|fff|ggg/ ) # special treatment needed for the CPX application&lt;BR /&gt;{&lt;BR /&gt;$environmentfile = "/main/obe/$phases[$t]/$LES_APPLI[$j]/com/etc/cfg/environment_$LES_APPLI[$j]";&lt;BR /&gt;print "check: $environmentfile\n";&lt;BR /&gt;look_for_environment "$environmentfile";&lt;BR /&gt;}&lt;BR /&gt;elsif ($LES_APPLI[$j] =~ /hhh/ ) # special treatment needed for the NGI&lt;BR /&gt;{&lt;BR /&gt;$environmentfile = "/main/obe/$phases[$t]/$LES_APPLI[$j]/com/etc/cfg/environment_com";&lt;BR /&gt;print "check: $environmentfile\n";&lt;BR /&gt;look_for_environment "$environmentfile";&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;$environmentfile = "/main/obe/$phases[$t]/$LES_APPLI[$j]/etc/cfg/environment_$LES_APPLI[$j]";&lt;BR /&gt;print "check: $environmentfile\n";&lt;BR /&gt;look_for_environment "$environmentfile";&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;#******************************************&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Oct 2005 21:16:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-with-a-perl-script-subroutine/m-p/3649286#M102401</guid>
      <dc:creator>MAD_2</dc:creator>
      <dc:date>2005-10-13T21:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a perl script subroutine...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-with-a-perl-script-subroutine/m-p/3649287#M102402</link>
      <description>This is orignally someone else's subrouting I am attempting to modify to make it fit new demands.&lt;BR /&gt;&lt;BR /&gt;Problem... It's looking at the array results and what it found then attempting to remove the files when they have already been removed; it then complains with errors like the following:&lt;BR /&gt;&lt;BR /&gt;++++++++++++++++++++++++++++++++++++++&lt;BR /&gt;&lt;BR /&gt;/main/obe/TST1/bbb/bint/core.20050928 not found&lt;BR /&gt;/usr/local/bin/sudo: Illegal option -f&lt;BR /&gt;usage: sudo -V | -h | -L | -l | -v | -k | -K | [-H] [-P] [-S] [-b] [-p prompt]&lt;BR /&gt;[-u username/#uid] -s | &lt;COMMAND&gt;&lt;BR /&gt;/main/obe/TST1/bbb/bint/core.20050930 not found&lt;BR /&gt;/usr/local/bin/sudo: Illegal option -f&lt;BR /&gt;usage: sudo -V | -h | -L | -l | -v | -k | -K | [-H] [-P] [-S] [-b] [-p prompt]&lt;BR /&gt;[-u username/#uid] -s | &lt;COMMAND&gt;&lt;BR /&gt;/main/obe/TST1/bbb/bint/core.20050929 not found&lt;BR /&gt;/usr/local/bin/sudo: Illegal option -f&lt;BR /&gt;usage: sudo -V | -h | -L | -l | -v | -k | -K | [-H] [-P] [-S] [-b] [-p prompt]&lt;BR /&gt;[-u username/#uid] -s | &lt;COMMAND&gt;&lt;BR /&gt;/main/obe/TST1/bbb/bint/core.20050926 not found&lt;BR /&gt;/usr/local/bin/sudo: Illegal option -f&lt;BR /&gt;usage: sudo -V | -h | -L | -l | -v | -k | -K | [-H] [-P] [-S] [-b] [-p prompt]&lt;BR /&gt;[-u username/#uid] -s | &lt;COMMAND&gt;&lt;BR /&gt;/main/obe/TST1/bbb/bint/core.20050922 not found&lt;BR /&gt;/usr/local/bin/sudo: Illegal option -f&lt;BR /&gt;usage: sudo -V | -h | -L | -l | -v | -k | -K | [-H] [-P] [-S] [-b] [-p prompt]&lt;BR /&gt;[-u username/#uid] -s | &lt;COMMAND&gt;&lt;BR /&gt;++++++++++++++++++++++++++++++++++++++&lt;BR /&gt;&lt;BR /&gt;This, after the files were actually found, they were there, they were also removed as per the subroutine's params... anyone see the mistake I've made on the modifications I have used?&lt;BR /&gt;&lt;BR /&gt;Thanks for any ideas...&lt;BR /&gt;&lt;BR /&gt;MAD&lt;/COMMAND&gt;&lt;/COMMAND&gt;&lt;/COMMAND&gt;&lt;/COMMAND&gt;&lt;/COMMAND&gt;</description>
      <pubDate>Thu, 13 Oct 2005 21:19:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-with-a-perl-script-subroutine/m-p/3649287#M102402</guid>
      <dc:creator>MAD_2</dc:creator>
      <dc:date>2005-10-13T21:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a perl script subroutine...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-with-a-perl-script-subroutine/m-p/3649288#M102403</link>
      <description>This is not a perl problem at all. In the end of the attached sub, you call:&lt;BR /&gt;&lt;BR /&gt;system "/usr/local/bin/sudo -H -u $uid /usr/bin/rm -f $veri" ;&lt;BR /&gt;&lt;BR /&gt;and the sudo you have installed states id does not support the -f option:&lt;BR /&gt;&lt;BR /&gt;usage: sudo -V | -h | -L | -l | -v | -k | -K | [-H] [-P] [-S] [-b] [-p prompt][-u username/#uid] -s | &lt;COMMAND&gt;&lt;BR /&gt;&lt;BR /&gt;So you will have to consult the man page of the installed sudo to check what options do what, and what to replace -f with.&lt;BR /&gt;Or get yourself a working copy of the sudo that *does* support the -f in the way the author of the sub intended it to be used.&lt;BR /&gt;&lt;BR /&gt;Standards++; :)&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn&lt;/COMMAND&gt;</description>
      <pubDate>Fri, 14 Oct 2005 02:08:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-with-a-perl-script-subroutine/m-p/3649288#M102403</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2005-10-14T02:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a perl script subroutine...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-with-a-perl-script-subroutine/m-p/3649289#M102404</link>
      <description>Pls do some shell work as,&lt;BR /&gt;&lt;BR /&gt;# which rm&lt;BR /&gt;&lt;BR /&gt;Is it /usr/bin/rm?&lt;BR /&gt;&lt;BR /&gt;# touch testfile&lt;BR /&gt;&lt;BR /&gt;Test 1:&lt;BR /&gt;# /usr/local/bin/sudo -H -u $uid /usr/bin/rm -f testfile&lt;BR /&gt;&lt;BR /&gt;Test2:&lt;BR /&gt;# /usr/local/bin/sudo -H -u $uid /usr/bin/rm -f testfile&lt;BR /&gt;&lt;BR /&gt;What are you getting for this now?&lt;BR /&gt;&lt;BR /&gt;hth.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 14 Oct 2005 02:09:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-with-a-perl-script-subroutine/m-p/3649289#M102404</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-10-14T02:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a perl script subroutine...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-with-a-perl-script-subroutine/m-p/3649290#M102405</link>
      <description>Thanks for the responses...&lt;BR /&gt;&lt;BR /&gt;I must agree with procura's thought because at first I also thought this to be the issue, however the "sudo" I am using supports the "rm -f" being used.  Furthermore, here is also another sub running in the same script using exactly the same sudo pattern which does not toss out any errors at all.  So, this had my very intriged, and I tried a few other variations, amongst them the one pointed out by hth:&lt;BR /&gt;&lt;BR /&gt;/usr/local/bin/sudo -H -u &lt;USER&gt; /usr/bin/rm core.20051003&lt;BR /&gt;&lt;BR /&gt;The problem resulted being the same when using that pattern.  However, in either case I must also state that the desired files to be removed "were removed!"  So, the sudo itself is working.  It appears as if it is again looking for the files which no longer exist.&lt;BR /&gt;&lt;BR /&gt;About the questions last asked by hth:&lt;BR /&gt;1)  node&amp;gt; which rm&lt;BR /&gt;/usr/bin/rm&lt;BR /&gt;&lt;BR /&gt;2)  I tried both (either works):&lt;BR /&gt;node&amp;gt; /usr/local/bin/sudo -H -u pdttdm /usr/bin/rm core.20051003&lt;BR /&gt;and &lt;BR /&gt;mucobt32&amp;gt; /usr/local/bin/sudo -H -u &lt;USER&gt; /usr/bin/rm -f core.20051003&lt;BR /&gt;&lt;BR /&gt;So, the problem lies elsewhere (I wish I knew where)...&lt;/USER&gt;&lt;/USER&gt;</description>
      <pubDate>Fri, 14 Oct 2005 05:44:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-with-a-perl-script-subroutine/m-p/3649290#M102405</guid>
      <dc:creator>MAD_2</dc:creator>
      <dc:date>2005-10-14T05:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a perl script subroutine...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-with-a-perl-script-subroutine/m-p/3649291#M102406</link>
      <description>Try to PRINT the command the will be executed by the system () call, and see if one of the expected arguments dropped of, so the arguments do not match&lt;BR /&gt;&lt;BR /&gt;call perl with the -w option to show you undef warnings&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Fri, 14 Oct 2005 06:02:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-with-a-perl-script-subroutine/m-p/3649291#M102406</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2005-10-14T06:02:56Z</dc:date>
    </item>
  </channel>
</rss>

