<?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 shell scripting in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripting/m-p/3082566#M811115</link>
    <description>Hi all, I must give to an internal procedure 4 parameters. This parameters are stored in a file.&lt;BR /&gt;I can't able to pass exactly these parameters to procedure.&lt;BR /&gt;&lt;BR /&gt;The file eith parameters is like&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;alpha beta gamma delta&lt;BR /&gt;delta beta gamma alfa&lt;BR /&gt;beta sigma delta pi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;the script is like:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;procedure ()&lt;BR /&gt;{&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;....&lt;BR /&gt;&lt;BR /&gt;I must read the /tmp/file1.txt and run procdure like:&lt;BR /&gt;procedure alpha beta gamma delta&lt;BR /&gt;&lt;BR /&gt;If I change IFS end i read file using:&lt;BR /&gt;&lt;BR /&gt;for i in $(cat /tmp/file1.txt)&lt;BR /&gt;do&lt;BR /&gt;procedure $i&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;procedure get "alpha beta gamma delta" like a single parameter so into procedure $1 is alpha beta gamma delta and $2 $3 $4 are not set.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Any idea?&lt;BR /&gt;&lt;BR /&gt;Thank You&lt;BR /&gt;&lt;/CODE&gt;</description>
    <pubDate>Wed, 01 Oct 2003 07:11:31 GMT</pubDate>
    <dc:creator>Mauro Gatti</dc:creator>
    <dc:date>2003-10-01T07:11:31Z</dc:date>
    <item>
      <title>shell scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripting/m-p/3082566#M811115</link>
      <description>Hi all, I must give to an internal procedure 4 parameters. This parameters are stored in a file.&lt;BR /&gt;I can't able to pass exactly these parameters to procedure.&lt;BR /&gt;&lt;BR /&gt;The file eith parameters is like&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;alpha beta gamma delta&lt;BR /&gt;delta beta gamma alfa&lt;BR /&gt;beta sigma delta pi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;the script is like:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;procedure ()&lt;BR /&gt;{&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;....&lt;BR /&gt;&lt;BR /&gt;I must read the /tmp/file1.txt and run procdure like:&lt;BR /&gt;procedure alpha beta gamma delta&lt;BR /&gt;&lt;BR /&gt;If I change IFS end i read file using:&lt;BR /&gt;&lt;BR /&gt;for i in $(cat /tmp/file1.txt)&lt;BR /&gt;do&lt;BR /&gt;procedure $i&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;procedure get "alpha beta gamma delta" like a single parameter so into procedure $1 is alpha beta gamma delta and $2 $3 $4 are not set.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Any idea?&lt;BR /&gt;&lt;BR /&gt;Thank You&lt;BR /&gt;&lt;/CODE&gt;</description>
      <pubDate>Wed, 01 Oct 2003 07:11:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripting/m-p/3082566#M811115</guid>
      <dc:creator>Mauro Gatti</dc:creator>
      <dc:date>2003-10-01T07:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: shell scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripting/m-p/3082567#M811116</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;while read a b c d&lt;BR /&gt;do&lt;BR /&gt;  yourproc $a $b $c $d&lt;BR /&gt;done &amp;lt; /tmp/file1.txt&lt;BR /&gt; &lt;BR /&gt;good luck,&lt;BR /&gt;Thierry.</description>
      <pubDate>Wed, 01 Oct 2003 07:19:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripting/m-p/3082567#M811116</guid>
      <dc:creator>Thierry Poels_1</dc:creator>
      <dc:date>2003-10-01T07:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: shell scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripting/m-p/3082568#M811117</link>
      <description>My addition would be the same as the previous reply.&lt;BR /&gt;&lt;BR /&gt;procedure() {&lt;BR /&gt;#&lt;BR /&gt;#&lt;BR /&gt;#&lt;BR /&gt;while read a b c d&lt;BR /&gt;do&lt;BR /&gt;other_proc ${a} ${b} ${c} ${d}&lt;BR /&gt;done &amp;lt; /tmp/file1.txt&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;off course you need to realize when you hit blank lines it will pass nothing at that time.&lt;BR /&gt;&lt;BR /&gt;handle blank lines this way&lt;BR /&gt;&lt;BR /&gt;procedure() {&lt;BR /&gt;#&lt;BR /&gt;cat /tmp/file1.txt | sed '/^$/d' | tee mydata&lt;BR /&gt;while read a b c d&lt;BR /&gt;do&lt;BR /&gt;my_other_proc ${a} $b} ${c} ${d}&lt;BR /&gt;done &lt;MYDATA&gt;&lt;/MYDATA&gt;}&lt;BR /&gt;&lt;BR /&gt;${a} is just a good programing habbit, to lock your variables. very usefull when the number of var's runs into the hundreds in the same script&lt;BR /&gt;peace&lt;BR /&gt;Donny</description>
      <pubDate>Wed, 01 Oct 2003 08:14:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripting/m-p/3082568#M811117</guid>
      <dc:creator>Donny Jekels</dc:creator>
      <dc:date>2003-10-01T08:14:02Z</dc:date>
    </item>
  </channel>
</rss>

