<?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: ksh, script help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script-help/m-p/5052963#M435089</link>
    <description>Thanks.  Not as complicated as I thought it might be :)&lt;BR /&gt;</description>
    <pubDate>Thu, 14 Jun 2007 07:58:05 GMT</pubDate>
    <dc:creator>Fred Martin_1</dc:creator>
    <dc:date>2007-06-14T07:58:05Z</dc:date>
    <item>
      <title>ksh, script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script-help/m-p/5052961#M435087</link>
      <description>I'm trying to decifer what this does, exactly:&lt;BR /&gt;&lt;BR /&gt;PF=/rd/opsys/${1:-editor}.pf&lt;BR /&gt;&lt;BR /&gt;I have a file called /rd/opsys/editor.pf, and I know in the script I'm looking at, it should resolve to PF=/rd/opsys/editor.pf.&lt;BR /&gt;&lt;BR /&gt;So what is  1:-&lt;BR /&gt;&lt;BR /&gt;It would seem 1 refers to the first parameter that is passed to the script, for if I pass one, it shows up in the value of PF.&lt;BR /&gt;&lt;BR /&gt;I'm guessing this means: if parameter 1 is set, take it's value, else use "editor"&lt;BR /&gt;&lt;BR /&gt;Am I off the mark?&lt;BR /&gt;&lt;BR /&gt;Fred&lt;BR /&gt;</description>
      <pubDate>Thu, 14 Jun 2007 07:19:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script-help/m-p/5052961#M435087</guid>
      <dc:creator>Fred Martin_1</dc:creator>
      <dc:date>2007-06-14T07:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: ksh, script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script-help/m-p/5052962#M435088</link>
      <description>Fred,&lt;BR /&gt;&lt;BR /&gt;You are correct.&lt;BR /&gt;&lt;BR /&gt;PCS</description>
      <pubDate>Thu, 14 Jun 2007 07:25:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script-help/m-p/5052962#M435088</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2007-06-14T07:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: ksh, script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script-help/m-p/5052963#M435089</link>
      <description>Thanks.  Not as complicated as I thought it might be :)&lt;BR /&gt;</description>
      <pubDate>Thu, 14 Jun 2007 07:58:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script-help/m-p/5052963#M435089</guid>
      <dc:creator>Fred Martin_1</dc:creator>
      <dc:date>2007-06-14T07:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: ksh, script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script-help/m-p/5052964#M435090</link>
      <description>To generalize about the ${something:-somethingElse}, this is a way to test if a value has been set and if not, assign a value. For instance, if a global variable called COLUMNS is not set, you want to set it to 80:&lt;BR /&gt; &lt;BR /&gt;COLUMNS=${COLUMNS:-80}&lt;BR /&gt; &lt;BR /&gt;You can even use this construct in a calculation:&lt;BR /&gt; &lt;BR /&gt;let ROWS=${ROWS:-24}-2&lt;BR /&gt; &lt;BR /&gt;So ROWS is now set to 2 less than actual or default value. In your example, 1 is shorthand for the first parameter passed to the current shell.</description>
      <pubDate>Thu, 14 Jun 2007 15:20:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script-help/m-p/5052964#M435090</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2007-06-14T15:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: ksh, script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script-help/m-p/5052965#M435091</link>
      <description>Hello (again) Fred,&lt;BR /&gt;&lt;BR /&gt;It's worth mentioning that this form of parameter substitution:&lt;BR /&gt;&lt;BR /&gt;${parameter:-word}&lt;BR /&gt;&lt;BR /&gt;will return 'word' if 'parameter' is unset and/or null, but WILL NOT set 'parameter' to the value of 'word'.  While this form:&lt;BR /&gt;&lt;BR /&gt;${parameter:=word}&lt;BR /&gt;&lt;BR /&gt;WILL set 'parameter' to the value of 'word' if 'parameter' is unset and/or null.&lt;BR /&gt;&lt;BR /&gt;In your particular example, you must use the first form, as the shell does not allow positional parameters (in your case: '$1') to  be set after the fact.&lt;BR /&gt;&lt;BR /&gt;PCS</description>
      <pubDate>Fri, 15 Jun 2007 07:03:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script-help/m-p/5052965#M435091</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2007-06-15T07:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: ksh, script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script-help/m-p/5052966#M435092</link>
      <description>Thanks folks, this is great information.&lt;BR /&gt;</description>
      <pubDate>Fri, 15 Jun 2007 07:09:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script-help/m-p/5052966#M435092</guid>
      <dc:creator>Fred Martin_1</dc:creator>
      <dc:date>2007-06-15T07:09:54Z</dc:date>
    </item>
  </channel>
</rss>

