<?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: &amp;gt; k=1 ; val$k=3  # how can i accomplish this? in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/gt-k-1-val-k-3-how-can-i-accomplish-this/m-p/2606695#M79438</link>
    <description>"in awk or gawk is there any way that i can export value ?"&lt;BR /&gt;&lt;BR /&gt;Sure :&lt;BR /&gt;&lt;BR /&gt;var=`awk '{n=1} {print n}'`&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Also, you can accomplish a lot more and have greater flexibility y writing your scipts in perl.&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
    <pubDate>Sun, 04 Nov 2001 20:29:52 GMT</pubDate>
    <dc:creator>harry d brown jr</dc:creator>
    <dc:date>2001-11-04T20:29:52Z</dc:date>
    <item>
      <title>&gt; k=1 ; val$k=3  # how can i accomplish this?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/gt-k-1-val-k-3-how-can-i-accomplish-this/m-p/2606692#M79435</link>
      <description>hello &lt;BR /&gt;&lt;BR /&gt;well, &lt;BR /&gt;&lt;BR /&gt;is there any way to achieve this? &lt;BR /&gt;------------------------------------ &lt;BR /&gt;k=1 &lt;BR /&gt;for i in p q r &lt;BR /&gt;do &lt;BR /&gt;ab$k=$i &lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;&amp;gt; echo "ab1=$ab1" # ab1=p &lt;BR /&gt;------------------------------------- &lt;BR /&gt;so that i can store each values in &lt;BR /&gt;ab1, ab2, ab3 so on .. &lt;BR /&gt;&lt;BR /&gt;or &lt;BR /&gt;in awk or gawk &lt;BR /&gt;is there any way that i can export value &lt;BR /&gt;in awk program? &lt;BR /&gt;like this? &lt;BR /&gt;-------------------------------------- &lt;BR /&gt;awk '{n=1} {print n}' &lt;BR /&gt;&lt;BR /&gt;&amp;gt;echo "n=$n" #n=1 &lt;BR /&gt;-------------------------------------- &lt;BR /&gt;&lt;BR /&gt;thx.. &lt;BR /&gt;&lt;BR /&gt;Eugene Kim&lt;BR /&gt;</description>
      <pubDate>Fri, 02 Nov 2001 20:40:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/gt-k-1-val-k-3-how-can-i-accomplish-this/m-p/2606692#M79435</guid>
      <dc:creator>eugene_6</dc:creator>
      <dc:date>2001-11-02T20:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: &gt; k=1 ; val$k=3  # how can i accomplish this?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/gt-k-1-val-k-3-how-can-i-accomplish-this/m-p/2606693#M79436</link>
      <description>I don't believe there is a way to set a variable name with another variable from a korn/borne shell.  &lt;BR /&gt;However, this would work if you used an array such as:&lt;BR /&gt;ab[${i}]=p</description>
      <pubDate>Fri, 02 Nov 2001 20:46:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/gt-k-1-val-k-3-how-can-i-accomplish-this/m-p/2606693#M79436</guid>
      <dc:creator>Bernie Vande Griend</dc:creator>
      <dc:date>2001-11-02T20:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: &gt; k=1 ; val$k=3  # how can i accomplish this?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/gt-k-1-val-k-3-how-can-i-accomplish-this/m-p/2606694#M79437</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;Sure, there's always a trick that does it in unix. :)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;k=1 &lt;BR /&gt;for i in p q r&lt;BR /&gt;do &lt;BR /&gt;  cmd=`echo ab$k=$i`&lt;BR /&gt;  eval $cmd &lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;That should solve your problem.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Paga&lt;BR /&gt;</description>
      <pubDate>Sun, 04 Nov 2001 00:50:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/gt-k-1-val-k-3-how-can-i-accomplish-this/m-p/2606694#M79437</guid>
      <dc:creator>Marco Paganini</dc:creator>
      <dc:date>2001-11-04T00:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: &gt; k=1 ; val$k=3  # how can i accomplish this?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/gt-k-1-val-k-3-how-can-i-accomplish-this/m-p/2606695#M79438</link>
      <description>"in awk or gawk is there any way that i can export value ?"&lt;BR /&gt;&lt;BR /&gt;Sure :&lt;BR /&gt;&lt;BR /&gt;var=`awk '{n=1} {print n}'`&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Also, you can accomplish a lot more and have greater flexibility y writing your scipts in perl.&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Sun, 04 Nov 2001 20:29:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/gt-k-1-val-k-3-how-can-i-accomplish-this/m-p/2606695#M79438</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2001-11-04T20:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: &gt; k=1 ; val$k=3  # how can i accomplish this?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/gt-k-1-val-k-3-how-can-i-accomplish-this/m-p/2606696#M79439</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;your basic problem is, that when the shell evaluates your variable, it just passed the part that usally sets variables (which is built in) and serches for commands.&lt;BR /&gt;&lt;BR /&gt;If you cann effort to export the variable,&lt;BR /&gt;simply do it, and your script will work.&lt;BR /&gt;See this from Red Hat 6.1&lt;BR /&gt;&lt;BR /&gt;$ a=3&lt;BR /&gt;$ export ab$a=4&lt;BR /&gt;$ echo $ab3&lt;BR /&gt;4&lt;BR /&gt;$ &lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;Volker</description>
      <pubDate>Mon, 05 Nov 2001 14:19:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/gt-k-1-val-k-3-how-can-i-accomplish-this/m-p/2606696#M79439</guid>
      <dc:creator>Volker Borowski</dc:creator>
      <dc:date>2001-11-05T14:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: &gt; k=1 ; val$k=3  # how can i accomplish this?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/gt-k-1-val-k-3-how-can-i-accomplish-this/m-p/2606697#M79440</link>
      <description>wow..&lt;BR /&gt;&lt;BR /&gt;i've searched all bash manual for this question .. (howto in linuxdoc and bash manual in &lt;A href="http://www.gnu.org)" target="_blank"&gt;www.gnu.org)&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;this is awesome..&lt;BR /&gt;&lt;BR /&gt;where do i have to go besides the above two sites to find answers that you provide?&lt;BR /&gt;(at least, i want to how the codes you provide work..)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and .. about awk question..&lt;BR /&gt;what if i have 2 or more variables in awk process?&lt;BR /&gt;for example..&lt;BR /&gt;awk '$1 ~ /-/ { option=option$1}&lt;BR /&gt;       $1 !` /-/ { argument=argument$`}'&lt;BR /&gt;is there any way to use variable option &amp;amp; argument outside of awk?&lt;BR /&gt;&lt;BR /&gt;here's what i do&lt;BR /&gt;=====================&lt;BR /&gt; mystring=`echo $input | &lt;BR /&gt;  awk 'BEGIN { RS=" " } &lt;BR /&gt;  $1 ~ /-/ {  option=option$1 }&lt;BR /&gt;  $1 !~ /-/ { arg=arg" "$1 }&lt;BR /&gt;  END {  print option; print arg }'  | sed 's/-/ /g'` #any way to store value which is visible outside awk?&lt;BR /&gt; &lt;BR /&gt;    option=`echo "$mystring" | sed -n '1p'`&lt;BR /&gt;    arg=`echo "$mystring" | sed -n '2p'`&lt;BR /&gt;=====================&lt;BR /&gt;any more elegant way?&lt;BR /&gt;--;&lt;BR /&gt;thx&lt;BR /&gt;Eugene Kim&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Nov 2001 00:01:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/gt-k-1-val-k-3-how-can-i-accomplish-this/m-p/2606697#M79440</guid>
      <dc:creator>eugene_6</dc:creator>
      <dc:date>2001-11-07T00:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: &gt; k=1 ; val$k=3  # how can i accomplish this?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/gt-k-1-val-k-3-how-can-i-accomplish-this/m-p/2606698#M79441</link>
      <description>&lt;BR /&gt;and..&lt;BR /&gt;here's what i figured out by myself&lt;BR /&gt;&lt;BR /&gt;another way to do &lt;BR /&gt;ab$c=3&lt;BR /&gt;when c=1&lt;BR /&gt;&lt;BR /&gt;---------------------&lt;BR /&gt;c=1&lt;BR /&gt;read ab$c &amp;lt;&amp;lt; eof&lt;BR /&gt;3&lt;BR /&gt;eof&lt;BR /&gt;echo $abc&lt;BR /&gt;3&lt;BR /&gt;---------------------&lt;BR /&gt;&lt;BR /&gt;:)&lt;BR /&gt;&lt;BR /&gt;Eugene Kim</description>
      <pubDate>Wed, 07 Nov 2001 20:57:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/gt-k-1-val-k-3-how-can-i-accomplish-this/m-p/2606698#M79441</guid>
      <dc:creator>eugene_6</dc:creator>
      <dc:date>2001-11-07T20:57:59Z</dc:date>
    </item>
    <item>
      <title>Re: &gt; k=1 ; val$k=3  # how can i accomplish this?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/gt-k-1-val-k-3-how-can-i-accomplish-this/m-p/2606699#M79442</link>
      <description>Hi Eugene,&lt;BR /&gt;&lt;BR /&gt;well "awk" is a very complex tool, I would not expect everything from the man-pages. Search amazon for awk. This one is quite OK&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.amazon.com/exec/obidos/ASIN/020107981X/qid=1005325986/sr=2-2/ref=sr_2_11_2/107-9238346-8792502" target="_blank"&gt;http://www.amazon.com/exec/obidos/ASIN/020107981X/qid=1005325986/sr=2-2/ref=sr_2_11_2/107-9238346-8792502&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;But from the man-pages, you might learn as well, there are system-variables like:&lt;BR /&gt;&lt;BR /&gt;   Built-in Variables&lt;BR /&gt;       Gawk's built-in variables are:&lt;BR /&gt;&lt;BR /&gt;       ARGC        The number of command line arguments (does not include options to gawk, or the program source).&lt;BR /&gt;&lt;BR /&gt;       ARGIND      The index in ARGV of the current file being processed.&lt;BR /&gt;&lt;BR /&gt;       ARGV        Array of command line arguments. The array is indexed from 0 to ARGC - 1.  Dynamically changing the&lt;BR /&gt;                   contents of ARGV can control the files used for data.&lt;BR /&gt;&lt;BR /&gt;       CONVFMT     The conversion format for numbers, "%.6g", by default.&lt;BR /&gt;&lt;BR /&gt;       ENVIRON     An array containing the values of the current environment.  The array is indexed by the environment&lt;BR /&gt;                   variables, each  element  being  the  value  of  that  variable  (e.g.,  ENVIRON["HOME"]  might  be&lt;BR /&gt;                   /home/arnold).   Changing  this  array  does not affect the environment seen by programs which gawk&lt;BR /&gt;                   spawns via redirection or the system() function.  (This may change in a future version of gawk.)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Of which ENVIRON and ARGV might be of most interest. Esp. ARGV[1], ARGV[2] ... to access the parameters.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;As far as your question concerning "bash" is required, I have to admit, I did not look up this behavior. I learned this loooooong time ago, when there was an old operating system called DOS, that has a completely diffrent behavior upon expanding wildcards (it simply does not do it!). &lt;BR /&gt;When I switched to UNIX, there where fundamental diffrences between a "sh" and "command.com" that I figured out more closely, than anyone new to "sh" would do today.&lt;BR /&gt;&lt;BR /&gt;Have fun learning "awk" it is real fun.&lt;BR /&gt;&lt;BR /&gt;So long&lt;BR /&gt;Volker&lt;BR /&gt;&lt;BR /&gt;BTW: would be nice if you would assign some points.</description>
      <pubDate>Fri, 09 Nov 2001 17:19:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/gt-k-1-val-k-3-how-can-i-accomplish-this/m-p/2606699#M79442</guid>
      <dc:creator>Volker Borowski</dc:creator>
      <dc:date>2001-11-09T17:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: &gt; k=1 ; val$k=3  # how can i accomplish this?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/gt-k-1-val-k-3-how-can-i-accomplish-this/m-p/2606700#M79443</link>
      <description>hey..&lt;BR /&gt;i'd like to give 10 points to all the people who helped me.&lt;BR /&gt;&lt;BR /&gt;this konquer browser gives me 404 nonfound(?) error&lt;BR /&gt;...even netscape doesn't work --;&lt;BR /&gt;&lt;BR /&gt;i'll make sure i'll give u points when i logged on with windows..&lt;BR /&gt;..&lt;BR /&gt;:)&lt;BR /&gt;Thx again&lt;BR /&gt;</description>
      <pubDate>Sat, 10 Nov 2001 03:55:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/gt-k-1-val-k-3-how-can-i-accomplish-this/m-p/2606700#M79443</guid>
      <dc:creator>eugene_6</dc:creator>
      <dc:date>2001-11-10T03:55:13Z</dc:date>
    </item>
  </channel>
</rss>

