<?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: Variable Syntax in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-syntax/m-p/4044944#M303541</link>
    <description>&lt;!--!*#--&gt;Sorry, not the argument, the value of $0 :)&lt;BR /&gt;&lt;BR /&gt;           ${parameter%pattern}&lt;BR /&gt;           ${parameter%%pattern}&lt;BR /&gt;                               If the shell pattern matches the end of the&lt;BR /&gt;                               value of parameter, the value of parameter&lt;BR /&gt;                               with the matched part is deleted; otherwise&lt;BR /&gt;                               substitute the value of parameter.  In the&lt;BR /&gt;                               former, the smallest matching pattern is&lt;BR /&gt;                               deleted; in the latter, the largest matching&lt;BR /&gt;                               pattern is deleted.&lt;BR /&gt;</description>
    <pubDate>Fri, 27 Jul 2007 04:48:43 GMT</pubDate>
    <dc:creator>Heiner E. Lennackers</dc:creator>
    <dc:date>2007-07-27T04:48:43Z</dc:date>
    <item>
      <title>Variable Syntax</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-syntax/m-p/4044941#M303538</link>
      <description>I just set up a HA NFS ServiceGuard package. The controlfile contains a line:&lt;BR /&gt;HA_NFS_SCRIPT="${0%/*}/hanfs.${HA_NFS_SCRIPT_EXTENSION:-sh}"&lt;BR /&gt;&lt;BR /&gt;What does "${0%/*}" stand for? I asked a few guys but nobody knows.&lt;BR /&gt;&lt;BR /&gt;If I run something like&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;echo ${0%/*}&lt;BR /&gt;&lt;BR /&gt;I get a ".", but if it means just . I would write ./hanfs.blahblah.&lt;BR /&gt;Does anybody understand what I am talking about!? ;-)&lt;BR /&gt;</description>
      <pubDate>Fri, 27 Jul 2007 04:29:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-syntax/m-p/4044941#M303538</guid>
      <dc:creator>Franz P</dc:creator>
      <dc:date>2007-07-27T04:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: Variable Syntax</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-syntax/m-p/4044942#M303539</link>
      <description>Hi Franz, i don't know what does "${0%/*}".&lt;BR /&gt;You can look this "sh" script for variables example:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;echo "$#:" $#&lt;BR /&gt;echo '$#:' $#&lt;BR /&gt;echo '$-:' $-&lt;BR /&gt;echo '$?:' $?&lt;BR /&gt;echo '$$:' $$&lt;BR /&gt;echo '$!:' $!&lt;BR /&gt;echo '$3:' $3&lt;BR /&gt;echo '$0:' $0&lt;BR /&gt;echo '$*:' $*&lt;BR /&gt;echo '$@:' $@&lt;BR /&gt;&lt;BR /&gt;If you execute it, obtain:&lt;BR /&gt;&lt;BR /&gt;$ ./variables.sh one two three four five&lt;BR /&gt;5: 5&lt;BR /&gt;$#: 5&lt;BR /&gt;$-:&lt;BR /&gt;$?: 0&lt;BR /&gt;$$: 12417&lt;BR /&gt;$!:&lt;BR /&gt;$3: three&lt;BR /&gt;$0: ./variables.sh&lt;BR /&gt;$*: one two three four five&lt;BR /&gt;$@: one two three four five&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Ernesto</description>
      <pubDate>Fri, 27 Jul 2007 04:43:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-syntax/m-p/4044942#M303539</guid>
      <dc:creator>Ernesto Cappello</dc:creator>
      <dc:date>2007-07-27T04:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: Variable Syntax</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-syntax/m-p/4044943#M303540</link>
      <description>Hi Franz,&lt;BR /&gt;&lt;BR /&gt;this will take the argument of $0 ( the name of your program including path ) and removes the last / and everything behind it.&lt;BR /&gt;&lt;BR /&gt;for example:&lt;BR /&gt;./program -&amp;gt; .&lt;BR /&gt;/usr/bin/test -&amp;gt; /usr/bin&lt;BR /&gt;&lt;BR /&gt;You can look into the manpage of your shell (e.g. man ksh) for details.&lt;BR /&gt;&lt;BR /&gt;HeL&lt;BR /&gt;</description>
      <pubDate>Fri, 27 Jul 2007 04:46:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-syntax/m-p/4044943#M303540</guid>
      <dc:creator>Heiner E. Lennackers</dc:creator>
      <dc:date>2007-07-27T04:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: Variable Syntax</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-syntax/m-p/4044944#M303541</link>
      <description>&lt;!--!*#--&gt;Sorry, not the argument, the value of $0 :)&lt;BR /&gt;&lt;BR /&gt;           ${parameter%pattern}&lt;BR /&gt;           ${parameter%%pattern}&lt;BR /&gt;                               If the shell pattern matches the end of the&lt;BR /&gt;                               value of parameter, the value of parameter&lt;BR /&gt;                               with the matched part is deleted; otherwise&lt;BR /&gt;                               substitute the value of parameter.  In the&lt;BR /&gt;                               former, the smallest matching pattern is&lt;BR /&gt;                               deleted; in the latter, the largest matching&lt;BR /&gt;                               pattern is deleted.&lt;BR /&gt;</description>
      <pubDate>Fri, 27 Jul 2007 04:48:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-syntax/m-p/4044944#M303541</guid>
      <dc:creator>Heiner E. Lennackers</dc:creator>
      <dc:date>2007-07-27T04:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: Variable Syntax</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-syntax/m-p/4044945#M303542</link>
      <description>See "Pattern-Matching Operators" - &lt;A href="http://www.oreilly.com/catalog/korn2/chapter/ch04.html" target="_blank"&gt;http://www.oreilly.com/catalog/korn2/chapter/ch04.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;ivan</description>
      <pubDate>Fri, 27 Jul 2007 04:53:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-syntax/m-p/4044945#M303542</guid>
      <dc:creator>Ivan Krastev</dc:creator>
      <dc:date>2007-07-27T04:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: Variable Syntax</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-syntax/m-p/4044946#M303543</link>
      <description>Thank you guys, your help is very appreciated! Even after 15yrs in IT you learn new features every day... :-0</description>
      <pubDate>Fri, 27 Jul 2007 06:24:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-syntax/m-p/4044946#M303543</guid>
      <dc:creator>Franz P</dc:creator>
      <dc:date>2007-07-27T06:24:04Z</dc:date>
    </item>
  </channel>
</rss>

