<?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 assignment in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/variable-assignment/m-p/3939864#M97462</link>
    <description>You can have arrays with up to 1024 values.  But you'll have to subscripts to check each value.  Or use vector methods to check both at once (grep).&lt;BR /&gt;&lt;BR /&gt;Of course you can always assign a string to a variable with a delimiter between them.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;i want it to hold 2 filetypes so that in my further comparisons, FILE can take either of the 2 values.&lt;BR /&gt;&lt;BR /&gt;I'm not sure what you want here.  Is there something in C that does what you want?  You don't want enums do you?</description>
    <pubDate>Wed, 07 Feb 2007 01:23:31 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2007-02-07T01:23:31Z</dc:date>
    <item>
      <title>Variable assignment</title>
      <link>https://community.hpe.com/t5/operating-system-linux/variable-assignment/m-p/3939863#M97461</link>
      <description>How can i assign 2 values to a single variable??&lt;BR /&gt;for eg: if i have a variable named FILE and i want it to hold 2 filetypes so that in my further comparisons, FILE can take either of the 2 values.&lt;BR /&gt;Can anybody suggest???</description>
      <pubDate>Wed, 07 Feb 2007 01:18:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/variable-assignment/m-p/3939863#M97461</guid>
      <dc:creator>Pavitra</dc:creator>
      <dc:date>2007-02-07T01:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: Variable assignment</title>
      <link>https://community.hpe.com/t5/operating-system-linux/variable-assignment/m-p/3939864#M97462</link>
      <description>You can have arrays with up to 1024 values.  But you'll have to subscripts to check each value.  Or use vector methods to check both at once (grep).&lt;BR /&gt;&lt;BR /&gt;Of course you can always assign a string to a variable with a delimiter between them.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;i want it to hold 2 filetypes so that in my further comparisons, FILE can take either of the 2 values.&lt;BR /&gt;&lt;BR /&gt;I'm not sure what you want here.  Is there something in C that does what you want?  You don't want enums do you?</description>
      <pubDate>Wed, 07 Feb 2007 01:23:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/variable-assignment/m-p/3939864#M97462</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-02-07T01:23:31Z</dc:date>
    </item>
    <item>
      <title>Re: Variable assignment</title>
      <link>https://community.hpe.com/t5/operating-system-linux/variable-assignment/m-p/3939865#M97463</link>
      <description>Dennis,&lt;BR /&gt;&lt;BR /&gt;will brief u on this.&lt;BR /&gt;i want FILE to hold 2 filetypes.&lt;BR /&gt;So that say.. if i want to put all the files with these filetypes somewhere else, i can directly use the variable FILE&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Feb 2007 01:37:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/variable-assignment/m-p/3939865#M97463</guid>
      <dc:creator>Pavitra</dc:creator>
      <dc:date>2007-02-07T01:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: Variable assignment</title>
      <link>https://community.hpe.com/t5/operating-system-linux/variable-assignment/m-p/3939866#M97464</link>
      <description>And also,&lt;BR /&gt;Can anybody give me the syntax for multiple if`s inside awk??</description>
      <pubDate>Wed, 07 Feb 2007 01:40:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/variable-assignment/m-p/3939866#M97464</guid>
      <dc:creator>Pavitra</dc:creator>
      <dc:date>2007-02-07T01:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: Variable assignment</title>
      <link>https://community.hpe.com/t5/operating-system-linux/variable-assignment/m-p/3939867#M97465</link>
      <description>&amp;gt;i want FILE to hold 2 filetypes.&lt;BR /&gt;So that say.. if i want to put all the files with these filetypes somewhere else, i can directly use the variable FILE&lt;BR /&gt;&lt;BR /&gt;Well, you can concatenate all of the files in one variable (blank separators) and then use $FILE in commands like mv, etc.&lt;BR /&gt;FILE=$(ls *.c)&lt;BR /&gt;&lt;BR /&gt;This will have the long string: a.c ... zzz.c&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Can anybody give me the syntax for multiple if's inside awk??&lt;BR /&gt;&lt;BR /&gt;Same as C:&lt;BR /&gt;if (abc == def) {&lt;BR /&gt;...&lt;BR /&gt;} else {&lt;BR /&gt;...&lt;BR /&gt;}&lt;BR /&gt;You can add if-blocks after, or inside other ifs.&lt;BR /&gt;&lt;BR /&gt;See awk(1).</description>
      <pubDate>Wed, 07 Feb 2007 02:07:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/variable-assignment/m-p/3939867#M97465</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-02-07T02:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: Variable assignment</title>
      <link>https://community.hpe.com/t5/operating-system-linux/variable-assignment/m-p/3939868#M97466</link>
      <description>Attached is a non-trivial awk program in C style.</description>
      <pubDate>Wed, 07 Feb 2007 02:48:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/variable-assignment/m-p/3939868#M97466</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-02-07T02:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: Variable assignment</title>
      <link>https://community.hpe.com/t5/operating-system-linux/variable-assignment/m-p/3939869#M97467</link>
      <description>&lt;!--!*#--&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;a general handling of your request can be done by arrays.&lt;BR /&gt;In the following awk example we check, if the second field matches one of the values in 'str' AND when the line contains 'here-we-are'. Having this verified, we process this line later:&lt;BR /&gt;&lt;BR /&gt;awk -v str='one two three' 'BEGIN {n=split(str,ary); found=0}&lt;BR /&gt;/here-we-are/ { for(i=1;i&amp;lt;=n;i++) if($2~ary[i]) {found=1;break} }&lt;BR /&gt;found { print "processing",$0 }'&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Wed, 07 Feb 2007 04:26:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/variable-assignment/m-p/3939869#M97467</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2007-02-07T04:26:28Z</dc:date>
    </item>
  </channel>
</rss>

