<?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: removing command line parameters to shell a script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/removing-command-line-parameters-to-shell-a-script/m-p/4924261#M816166</link>
    <description>Note that because "b" is invoked via "." (dot), that all of this is actually one process "a". There is no child process "b".&lt;BR /&gt;&lt;BR /&gt;what you can do is:&lt;BR /&gt;set ""&lt;BR /&gt;. b&lt;BR /&gt;&lt;BR /&gt;The set "" will clear all positional variables.&lt;BR /&gt;&lt;BR /&gt;If you still need access to these variables in "a" after "b" has been invoked then you can save thenm in a temporary variable (which will be visible to "b" since it's the same process but presumably "b" will have no knowledge of your data hiding).&lt;BR /&gt;&lt;BR /&gt;XX=${@}&lt;BR /&gt;set "" # positional variables are cleared&lt;BR /&gt;. b&lt;BR /&gt;set ${XX} # positional variables are now restored &lt;BR /&gt;</description>
    <pubDate>Wed, 07 Sep 2005 10:11:13 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2005-09-07T10:11:13Z</dc:date>
    <item>
      <title>removing command line parameters to shell a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/removing-command-line-parameters-to-shell-a-script/m-p/4924258#M816163</link>
      <description>Hi All,&lt;BR /&gt;I have two shell scripts, say 'a' and 'b'.&lt;BR /&gt;Contents are as given below:&lt;BR /&gt;&lt;BR /&gt;# file 'a'&lt;BR /&gt;echo "in a: $*"&lt;BR /&gt;. b&lt;BR /&gt;----------------------&lt;BR /&gt;# file 'b'&lt;BR /&gt;echo "in b: $*"&lt;BR /&gt;----------------------&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;When I invoke 'a' with some command line parameters, those are seen by 'b' also (sourcing effect); but I do not want 'b' to be aware of the command line parameters to 'a'.&lt;BR /&gt;&lt;BR /&gt;Since 'b' sets environment variables for 'a', I have to source it as given above.&lt;BR /&gt;&lt;BR /&gt;Also note that I cannot edit script 'b'.&lt;BR /&gt;&lt;BR /&gt;Any ideas how to unset those command line parameters?&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Sep 2005 09:56:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/removing-command-line-parameters-to-shell-a-script/m-p/4924258#M816163</guid>
      <dc:creator>Srini Jay</dc:creator>
      <dc:date>2005-09-07T09:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: removing command line parameters to shell a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/removing-command-line-parameters-to-shell-a-script/m-p/4924259#M816164</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Use 'shift' to chop off the number of arguments before sourcing the second script:&lt;BR /&gt;&lt;BR /&gt;# file 'a'&lt;BR /&gt;echo "in a: $*"&lt;BR /&gt;shift $#&lt;BR /&gt;. b&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 07 Sep 2005 10:04:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/removing-command-line-parameters-to-shell-a-script/m-p/4924259#M816164</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-09-07T10:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: removing command line parameters to shell a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/removing-command-line-parameters-to-shell-a-script/m-p/4924260#M816165</link>
      <description>Thanks James!&lt;BR /&gt;That works!!!</description>
      <pubDate>Wed, 07 Sep 2005 10:07:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/removing-command-line-parameters-to-shell-a-script/m-p/4924260#M816165</guid>
      <dc:creator>Srini Jay</dc:creator>
      <dc:date>2005-09-07T10:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: removing command line parameters to shell a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/removing-command-line-parameters-to-shell-a-script/m-p/4924261#M816166</link>
      <description>Note that because "b" is invoked via "." (dot), that all of this is actually one process "a". There is no child process "b".&lt;BR /&gt;&lt;BR /&gt;what you can do is:&lt;BR /&gt;set ""&lt;BR /&gt;. b&lt;BR /&gt;&lt;BR /&gt;The set "" will clear all positional variables.&lt;BR /&gt;&lt;BR /&gt;If you still need access to these variables in "a" after "b" has been invoked then you can save thenm in a temporary variable (which will be visible to "b" since it's the same process but presumably "b" will have no knowledge of your data hiding).&lt;BR /&gt;&lt;BR /&gt;XX=${@}&lt;BR /&gt;set "" # positional variables are cleared&lt;BR /&gt;. b&lt;BR /&gt;set ${XX} # positional variables are now restored &lt;BR /&gt;</description>
      <pubDate>Wed, 07 Sep 2005 10:11:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/removing-command-line-parameters-to-shell-a-script/m-p/4924261#M816166</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-09-07T10:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: removing command line parameters to shell a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/removing-command-line-parameters-to-shell-a-script/m-p/4924262#M816167</link>
      <description>When you call b do-&lt;BR /&gt; &lt;BR /&gt;. b ""&lt;BR /&gt; &lt;BR /&gt;This will set the command parameters to empty.&lt;BR /&gt; &lt;BR /&gt;Or you could use "shift $#" in a.&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Wed, 07 Sep 2005 10:13:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/removing-command-line-parameters-to-shell-a-script/m-p/4924262#M816167</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2005-09-07T10:13:10Z</dc:date>
    </item>
  </channel>
</rss>

