<?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 for loop processing problem in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-processing-problem/m-p/3356815#M712972</link>
    <description>&lt;BR /&gt;I am doing some processing against the /home&lt;BR /&gt;directory for certain users and am having an error I'm not sure how to resolve..&lt;BR /&gt;&lt;BR /&gt;I'm entering:&lt;BR /&gt;&lt;BR /&gt;cd /home&lt;BR /&gt;for user in tupz* u* dis*; do echo $user; done&lt;BR /&gt;&lt;BR /&gt;The output from this command return:&lt;BR /&gt;tupzab4&lt;BR /&gt;tupzhb6&lt;BR /&gt;tupzjmb&lt;BR /&gt;ual001&lt;BR /&gt;ubs000&lt;BR /&gt;ucb006&lt;BR /&gt;uck002&lt;BR /&gt;udf003&lt;BR /&gt;uds003&lt;BR /&gt;dis*&lt;BR /&gt;&lt;BR /&gt;If it doesn't find a user starting with "dis" as in this case, it tries to process a user called: "dis*"&lt;BR /&gt;&lt;BR /&gt;Is there anything I can do to eliminate this&lt;BR /&gt;problem???&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;dis*&lt;BR /&gt;[root@us1lxmgt01 /home]#</description>
    <pubDate>Fri, 13 Aug 2004 09:54:15 GMT</pubDate>
    <dc:creator>MikeL_4</dc:creator>
    <dc:date>2004-08-13T09:54:15Z</dc:date>
    <item>
      <title>for loop processing problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-processing-problem/m-p/3356815#M712972</link>
      <description>&lt;BR /&gt;I am doing some processing against the /home&lt;BR /&gt;directory for certain users and am having an error I'm not sure how to resolve..&lt;BR /&gt;&lt;BR /&gt;I'm entering:&lt;BR /&gt;&lt;BR /&gt;cd /home&lt;BR /&gt;for user in tupz* u* dis*; do echo $user; done&lt;BR /&gt;&lt;BR /&gt;The output from this command return:&lt;BR /&gt;tupzab4&lt;BR /&gt;tupzhb6&lt;BR /&gt;tupzjmb&lt;BR /&gt;ual001&lt;BR /&gt;ubs000&lt;BR /&gt;ucb006&lt;BR /&gt;uck002&lt;BR /&gt;udf003&lt;BR /&gt;uds003&lt;BR /&gt;dis*&lt;BR /&gt;&lt;BR /&gt;If it doesn't find a user starting with "dis" as in this case, it tries to process a user called: "dis*"&lt;BR /&gt;&lt;BR /&gt;Is there anything I can do to eliminate this&lt;BR /&gt;problem???&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;dis*&lt;BR /&gt;[root@us1lxmgt01 /home]#</description>
      <pubDate>Fri, 13 Aug 2004 09:54:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-processing-problem/m-p/3356815#M712972</guid>
      <dc:creator>MikeL_4</dc:creator>
      <dc:date>2004-08-13T09:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: for loop processing problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-processing-problem/m-p/3356816#M712973</link>
      <description>for user in tupz* u* dis*; do echo $user 2&amp;gt; /dev/null; done&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Fri, 13 Aug 2004 09:58:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-processing-problem/m-p/3356816#M712973</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2004-08-13T09:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: for loop processing problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-processing-problem/m-p/3356817#M712974</link>
      <description>for user in `ls -d tupz* u* dis*`&lt;BR /&gt;&lt;BR /&gt;this will populate with only matches.</description>
      <pubDate>Fri, 13 Aug 2004 10:02:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-processing-problem/m-p/3356817#M712974</guid>
      <dc:creator>Simon Hargrave</dc:creator>
      <dc:date>2004-08-13T10:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: for loop processing problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-processing-problem/m-p/3356818#M712975</link>
      <description>you can simply use as,&lt;BR /&gt;&lt;BR /&gt; ll /home/ | grep -E '^d' | grep -E '  tupz[^*]|u[^*]|dis[^*] '&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 13 Aug 2004 10:29:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-processing-problem/m-p/3356818#M712975</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-08-13T10:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: for loop processing problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-processing-problem/m-p/3356819#M712976</link>
      <description>By definition ksh/sh will not expand a word if there is no matching filename. csh behaves differently.&lt;BR /&gt; &lt;BR /&gt;A possibile solution to prevent "dis*" from being processed, is to add the following after the "for" command-&lt;BR /&gt; &lt;BR /&gt;if [[ $user != ${user%%\*} ]] ; then continue ; fi&lt;BR /&gt; &lt;BR /&gt;This if statement tests $user to see if it ends with a "*". If so then skip it.&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Fri, 13 Aug 2004 10:51:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-processing-problem/m-p/3356819#M712976</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2004-08-13T10:51:33Z</dc:date>
    </item>
  </channel>
</rss>

