<?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 How to capture * without automatic expansion in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-capture-without-automatic-expansion/m-p/3083132#M143118</link>
    <description>Here's what I want to do.&lt;BR /&gt;&lt;BR /&gt;User enters:   myprogram.sh *&lt;BR /&gt;I want to just capture the asterick (*), I don't want the filename expansion.  Later in the program I use the * to help derive filenames from a different directory.  How can I do this?&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;MYVAR=$*&lt;BR /&gt;if  [ "X*" = "X${MYVAR}" ] ; then&lt;BR /&gt;     ll -d /var/spool/lp/request/*&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;I tried using set -f but it only does it for the current shell and not the script.&lt;BR /&gt;&lt;BR /&gt;Thanks...&lt;BR /&gt;Jack...&lt;BR /&gt;</description>
    <pubDate>Wed, 01 Oct 2003 13:55:42 GMT</pubDate>
    <dc:creator>Jack C. Mahaffey</dc:creator>
    <dc:date>2003-10-01T13:55:42Z</dc:date>
    <item>
      <title>How to capture * without automatic expansion</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-capture-without-automatic-expansion/m-p/3083132#M143118</link>
      <description>Here's what I want to do.&lt;BR /&gt;&lt;BR /&gt;User enters:   myprogram.sh *&lt;BR /&gt;I want to just capture the asterick (*), I don't want the filename expansion.  Later in the program I use the * to help derive filenames from a different directory.  How can I do this?&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;MYVAR=$*&lt;BR /&gt;if  [ "X*" = "X${MYVAR}" ] ; then&lt;BR /&gt;     ll -d /var/spool/lp/request/*&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;I tried using set -f but it only does it for the current shell and not the script.&lt;BR /&gt;&lt;BR /&gt;Thanks...&lt;BR /&gt;Jack...&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Oct 2003 13:55:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-capture-without-automatic-expansion/m-p/3083132#M143118</guid>
      <dc:creator>Jack C. Mahaffey</dc:creator>
      <dc:date>2003-10-01T13:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to capture * without automatic expansion</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-capture-without-automatic-expansion/m-p/3083133#M143119</link>
      <description>&lt;BR /&gt;   set -o noglob&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Oct 2003 13:58:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-capture-without-automatic-expansion/m-p/3083133#M143119</guid>
      <dc:creator>Sundar_7</dc:creator>
      <dc:date>2003-10-01T13:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to capture * without automatic expansion</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-capture-without-automatic-expansion/m-p/3083134#M143120</link>
      <description>you coud put "set -f" in your script of course.</description>
      <pubDate>Wed, 01 Oct 2003 13:59:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-capture-without-automatic-expansion/m-p/3083134#M143120</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2003-10-01T13:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to capture * without automatic expansion</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-capture-without-automatic-expansion/m-p/3083135#M143121</link>
      <description>escape it '*' or \*</description>
      <pubDate>Wed, 01 Oct 2003 13:59:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-capture-without-automatic-expansion/m-p/3083135#M143121</guid>
      <dc:creator>Kevin Wright</dc:creator>
      <dc:date>2003-10-01T13:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to capture * without automatic expansion</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-capture-without-automatic-expansion/m-p/3083136#M143122</link>
      <description>myprogram.sh \*&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;myprogram.sh "*"</description>
      <pubDate>Wed, 01 Oct 2003 14:00:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-capture-without-automatic-expansion/m-p/3083136#M143122</guid>
      <dc:creator>Stuart Abramson_2</dc:creator>
      <dc:date>2003-10-01T14:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to capture * without automatic expansion</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-capture-without-automatic-expansion/m-p/3083137#M143123</link>
      <description>Use a backslash along with any special character in a search.&lt;BR /&gt; &lt;BR /&gt;find /dir -name "\*"&lt;BR /&gt;-or-&lt;BR /&gt;grep "\*" file&lt;BR /&gt;-or-&lt;BR /&gt;Use inode numbers.&lt;BR /&gt; &lt;BR /&gt;ls -i (* write down inode number *)&lt;BR /&gt;&lt;BR /&gt;find /dir -inum ### | awk ' { print $NF ) '</description>
      <pubDate>Wed, 01 Oct 2003 14:09:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-capture-without-automatic-expansion/m-p/3083137#M143123</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2003-10-01T14:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to capture * without automatic expansion</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-capture-without-automatic-expansion/m-p/3083138#M143124</link>
      <description>Using the \* option apparently is the best approach.  I was hoping to intercept the * in the program.   &lt;BR /&gt;&lt;BR /&gt;I tried setting the noglob / -f options in the script and it didn't work when I looked at the variable in the program.  It still expanded.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;thanks all...&lt;BR /&gt;&lt;BR /&gt;Jack</description>
      <pubDate>Wed, 01 Oct 2003 14:57:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-capture-without-automatic-expansion/m-p/3083138#M143124</guid>
      <dc:creator>Jack C. Mahaffey</dc:creator>
      <dc:date>2003-10-01T14:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to capture * without automatic expansion</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-capture-without-automatic-expansion/m-p/3083139#M143125</link>
      <description>The problem is that your script nev er gets a chance to change the behavior of shell expansion...it occurred BEFORE you started the script. Your local shell does the expansion by default. To see this, rather than entering myprogram *, type:&lt;BR /&gt; &lt;BR /&gt;echo myprogram *&lt;BR /&gt; &lt;BR /&gt;Wow! myprogram now has a long list of filenames because the local shell expanded the list before myprogram even got started. This, the \* construct tells the CURRENT shell to stop any expansion on the next character. You can type this:&lt;BR /&gt; &lt;BR /&gt;set -f&lt;BR /&gt;myprogram *&lt;BR /&gt; &lt;BR /&gt;and it will work fine. BUT now something like ls *txt or echo *abc* will no longer produce any file matches because set -f turns of special character expansion permanently. This, the \* mechanism is the best choice. Another alternative is to tell users that anything besides alphanumerics should always be enclosed in quotes:&lt;BR /&gt; &lt;BR /&gt;myprogram "*"&lt;BR /&gt; &lt;BR /&gt;This tends to be more portable across other opsystems too (special characters require special handling).</description>
      <pubDate>Wed, 01 Oct 2003 16:11:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-capture-without-automatic-expansion/m-p/3083139#M143125</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2003-10-01T16:11:27Z</dc:date>
    </item>
  </channel>
</rss>

