<?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 Random Variable at Shell Script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/random-variable-at-shell-script/m-p/2773526#M722348</link>
    <description>&lt;BR /&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;I need to do the following:&lt;BR /&gt;&lt;BR /&gt;var1=&lt;RANDOM variable=""&gt;;&lt;BR /&gt;echo $var1 &amp;gt; file.txt&lt;BR /&gt;sleep 30;&lt;BR /&gt;var2=cat file.txt&lt;BR /&gt;If var1 = var 2 the&lt;BR /&gt;&lt;BR /&gt;....&lt;BR /&gt;&lt;BR /&gt;The problem is : How to create a random variable using shell only ( bash, korn )&lt;BR /&gt;&lt;BR /&gt;&lt;/RANDOM&gt;</description>
    <pubDate>Fri, 26 Jul 2002 12:16:23 GMT</pubDate>
    <dc:creator>Ricardo Bassoi</dc:creator>
    <dc:date>2002-07-26T12:16:23Z</dc:date>
    <item>
      <title>Random Variable at Shell Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/random-variable-at-shell-script/m-p/2773526#M722348</link>
      <description>&lt;BR /&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;I need to do the following:&lt;BR /&gt;&lt;BR /&gt;var1=&lt;RANDOM variable=""&gt;;&lt;BR /&gt;echo $var1 &amp;gt; file.txt&lt;BR /&gt;sleep 30;&lt;BR /&gt;var2=cat file.txt&lt;BR /&gt;If var1 = var 2 the&lt;BR /&gt;&lt;BR /&gt;....&lt;BR /&gt;&lt;BR /&gt;The problem is : How to create a random variable using shell only ( bash, korn )&lt;BR /&gt;&lt;BR /&gt;&lt;/RANDOM&gt;</description>
      <pubDate>Fri, 26 Jul 2002 12:16:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/random-variable-at-shell-script/m-p/2773526#M722348</guid>
      <dc:creator>Ricardo Bassoi</dc:creator>
      <dc:date>2002-07-26T12:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Random Variable at Shell Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/random-variable-at-shell-script/m-p/2773527#M722349</link>
      <description>Try random (3M).&lt;BR /&gt;&lt;BR /&gt;# man random&lt;BR /&gt; DESCRIPTION&lt;BR /&gt;The random() and srandom() functions are random-number generators that have virtually the same calling sequence and initialization properties as the rand() and srand() functions, but produce sequences that are  more random&lt;BR /&gt;Cheryl</description>
      <pubDate>Fri, 26 Jul 2002 12:18:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/random-variable-at-shell-script/m-p/2773527#M722349</guid>
      <dc:creator>Cheryl Griffin</dc:creator>
      <dc:date>2002-07-26T12:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: Random Variable at Shell Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/random-variable-at-shell-script/m-p/2773528#M722350</link>
      <description>&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x67657e990647d4118fee0090279cd0f9,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x67657e990647d4118fee0090279cd0f9,00.html&lt;/A&gt; is a example.&lt;BR /&gt;&lt;BR /&gt;Search the forums and you will find more.&lt;BR /&gt;&lt;BR /&gt;Search from the left, enter random in the search box and click the option for Community Forum.&lt;BR /&gt;&lt;BR /&gt;Cheryl</description>
      <pubDate>Fri, 26 Jul 2002 12:21:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/random-variable-at-shell-script/m-p/2773528#M722350</guid>
      <dc:creator>Cheryl Griffin</dc:creator>
      <dc:date>2002-07-26T12:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: Random Variable at Shell Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/random-variable-at-shell-script/m-p/2773529#M722351</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;Is there a way to run this random cmd using only shell script ? ( not C or PERL )&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;</description>
      <pubDate>Fri, 26 Jul 2002 12:23:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/random-variable-at-shell-script/m-p/2773529#M722351</guid>
      <dc:creator>Ricardo Bassoi</dc:creator>
      <dc:date>2002-07-26T12:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: Random Variable at Shell Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/random-variable-at-shell-script/m-p/2773530#M722352</link>
      <description>Ricardo,&lt;BR /&gt;&lt;BR /&gt;There is actually an environment variable named RANDOM which suits your need.&lt;BR /&gt;&lt;BR /&gt;Try several of these to see for yourself&lt;BR /&gt;# echo $RANDOM&lt;BR /&gt;# echo $RANDOM # diff. output&lt;BR /&gt;# ...&lt;BR /&gt;&lt;BR /&gt;Hai</description>
      <pubDate>Fri, 26 Jul 2002 12:29:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/random-variable-at-shell-script/m-p/2773530#M722352</guid>
      <dc:creator>Hai Nguyen_1</dc:creator>
      <dc:date>2002-07-26T12:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Random Variable at Shell Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/random-variable-at-shell-script/m-p/2773531#M722353</link>
      <description>Heres an example of using random - &lt;BR /&gt;&lt;BR /&gt;RANDOM=$(date +%S)                                                              &lt;BR /&gt;MESS=$((RANDOM % 5))&lt;BR /&gt;case $MESS in &lt;BR /&gt;1) echo "Random number 1 generated";;&lt;BR /&gt;2) echo "Random number 2 generated";;&lt;BR /&gt;3) echo "Random number 3 generated";;&lt;BR /&gt;4) echo "Random number 4 generated";;&lt;BR /&gt;5) echo "Random number 5 generated";;&lt;BR /&gt;esac&lt;BR /&gt;&lt;BR /&gt;The first "variable" RANDOM sets the "seed" (randomness if you like) based on the current date. The variable MESS is then chosen at random between 1 &amp;amp; 5.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 26 Jul 2002 14:51:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/random-variable-at-shell-script/m-p/2773531#M722353</guid>
      <dc:creator>Nick Wickens</dc:creator>
      <dc:date>2002-07-26T14:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: Random Variable at Shell Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/random-variable-at-shell-script/m-p/2773532#M722354</link>
      <description>Opps Sorry - Actually the example I gave generates a RANDOM number between 0 and 5 !!</description>
      <pubDate>Fri, 26 Jul 2002 14:53:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/random-variable-at-shell-script/m-p/2773532#M722354</guid>
      <dc:creator>Nick Wickens</dc:creator>
      <dc:date>2002-07-26T14:53:08Z</dc:date>
    </item>
  </channel>
</rss>

