<?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: another question for scripting in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/another-question-for-scripting/m-p/4761527#M657181</link>
    <description>&lt;!--!*#--&gt;A Google search for keywords like, say:&lt;BR /&gt;&lt;BR /&gt;      shell script primer&lt;BR /&gt;&lt;BR /&gt;or:&lt;BR /&gt;&lt;BR /&gt;      shell script tutorial&lt;BR /&gt;&lt;BR /&gt;might also be helpful.</description>
    <pubDate>Fri, 04 Mar 2011 17:15:30 GMT</pubDate>
    <dc:creator>Steven Schweda</dc:creator>
    <dc:date>2011-03-04T17:15:30Z</dc:date>
    <item>
      <title>another question for scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/another-question-for-scripting/m-p/4761525#M657179</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have a script and an input file.  I would like to declare some of those variable in the input file so each time I can just pass the input file to the script.  This will save my time of trying to create 20 scripts for 20 servers.&lt;BR /&gt;&lt;BR /&gt;For example, I can simply run&lt;BR /&gt;&lt;BR /&gt;script.sh myinputfile.&lt;BR /&gt;&lt;BR /&gt;The reason for that is because the input file will have set of variable define and will be different for all the machine.&lt;BR /&gt;&lt;BR /&gt;Here is how myinputfile look like&lt;BR /&gt;myinputfile:&lt;BR /&gt;servername=Venus&lt;BR /&gt;serverowner=Alex&lt;BR /&gt;Serverapps="Oracle:Sun:ERP"&lt;BR /&gt;&lt;BR /&gt;so when I run the script.sh it will take those variable define in myinputfile and execute the script accordingly.&lt;BR /&gt;&lt;BR /&gt;What is the best way to do this?</description>
      <pubDate>Fri, 04 Mar 2011 17:07:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/another-question-for-scripting/m-p/4761525#M657179</guid>
      <dc:creator>kholikt</dc:creator>
      <dc:date>2011-03-04T17:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: another question for scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/another-question-for-scripting/m-p/4761526#M657180</link>
      <description>&lt;!--!*#--&gt;      man sh&lt;BR /&gt;&lt;BR /&gt;Perhaps:&lt;BR /&gt;&lt;BR /&gt;      .  myinputfile&lt;BR /&gt;&lt;BR /&gt;Or, if you want to put the file name on the&lt;BR /&gt;shell script's command line:&lt;BR /&gt;&lt;BR /&gt;      .  "$1"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Did I suggest "man sh"?</description>
      <pubDate>Fri, 04 Mar 2011 17:14:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/another-question-for-scripting/m-p/4761526#M657180</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2011-03-04T17:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: another question for scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/another-question-for-scripting/m-p/4761527#M657181</link>
      <description>&lt;!--!*#--&gt;A Google search for keywords like, say:&lt;BR /&gt;&lt;BR /&gt;      shell script primer&lt;BR /&gt;&lt;BR /&gt;or:&lt;BR /&gt;&lt;BR /&gt;      shell script tutorial&lt;BR /&gt;&lt;BR /&gt;might also be helpful.</description>
      <pubDate>Fri, 04 Mar 2011 17:15:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/another-question-for-scripting/m-p/4761527#M657181</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2011-03-04T17:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: another question for scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/another-question-for-scripting/m-p/4761528#M657182</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;You need to 'source' (read) the input file into your environment:&lt;BR /&gt;&lt;BR /&gt;# . /myinputfile&lt;BR /&gt;&lt;BR /&gt;Note carefully the dot ('.') followed by *whitespace* and then the name of the file containing the variables you want to import into your environment:&lt;BR /&gt;&lt;BR /&gt;# cat ./mysh&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;. /myinputfile&lt;BR /&gt;echo "I am ${servername}"&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 04 Mar 2011 17:15:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/another-question-for-scripting/m-p/4761528#M657182</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-03-04T17:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: another question for scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/another-question-for-scripting/m-p/4761529#M657183</link>
      <description>&amp;gt;I have a script and an input file. I would like to declare some of those variables in the input file&lt;BR /&gt;&lt;BR /&gt;Do you have anything else in your input file other than variables?&lt;BR /&gt;The above sourcing solutions only expect shell commands there.</description>
      <pubDate>Sat, 05 Mar 2011 02:17:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/another-question-for-scripting/m-p/4761529#M657183</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-03-05T02:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: another question for scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/another-question-for-scripting/m-p/4761530#M657184</link>
      <description>Yes the above solution only work for data file.  In my scenario the file should be only variable.  Not sure whether in shell script has anything similar like php script that you have an include statement to include other file.</description>
      <pubDate>Sat, 05 Mar 2011 03:07:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/another-question-for-scripting/m-p/4761530#M657184</guid>
      <dc:creator>kholikt</dc:creator>
      <dc:date>2011-03-05T03:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: another question for scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/another-question-for-scripting/m-p/4761531#M657185</link>
      <description>&amp;gt;like php script that you have an include statement&lt;BR /&gt;&lt;BR /&gt;As JRF said, that's called sourcing, using a ".".  (In the scummy C shell, it's "source".)</description>
      <pubDate>Sat, 05 Mar 2011 03:19:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/another-question-for-scripting/m-p/4761531#M657185</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-03-05T03:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: another question for scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/another-question-for-scripting/m-p/4761532#M657186</link>
      <description>yep source is the keyword and I manage do it right</description>
      <pubDate>Sat, 05 Mar 2011 08:34:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/another-question-for-scripting/m-p/4761532#M657186</guid>
      <dc:creator>kholikt</dc:creator>
      <dc:date>2011-03-05T08:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: another question for scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/another-question-for-scripting/m-p/4761533#M657187</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; yep source is the keyword and I manage do it right&lt;BR /&gt;&lt;BR /&gt;And you will recall that "sourcing" was the term I used.&lt;BR /&gt;&lt;BR /&gt;It would have helped both *you* and *us* if you had _defined_ your environment better.  In this HP-UX forum, in the absence of stating otherwise, it is fair to assume that shell-related questions are for the POSIX shell ('/usr/bin/sh' or /sbin/sh') unless otherwise stated.&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Sat, 05 Mar 2011 14:18:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/another-question-for-scripting/m-p/4761533#M657187</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-03-05T14:18:54Z</dc:date>
    </item>
  </channel>
</rss>

