<?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 awk script in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/awk-script/m-p/3727279#M100925</link>
    <description>I have the following awk script&lt;BR /&gt;&lt;BR /&gt;list="apple:fruit&lt;BR /&gt;      dog:animal"&lt;BR /&gt;&lt;BR /&gt;for i in $list;&lt;BR /&gt;do&lt;BR /&gt;  echo $i |awk -F: '{ vob =$1; vobpath=$2;&lt;BR /&gt;         "unix-command  vob" }'&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;I want to run a unix-command within awk, can it be done?&lt;BR /&gt;&lt;BR /&gt;how do I let the unix command know "vob" is not literal "vob", but a variable?&lt;BR /&gt;&lt;BR /&gt;thank you</description>
    <pubDate>Wed, 08 Feb 2006 15:38:00 GMT</pubDate>
    <dc:creator>Gemini_2</dc:creator>
    <dc:date>2006-02-08T15:38:00Z</dc:date>
    <item>
      <title>awk script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk-script/m-p/3727279#M100925</link>
      <description>I have the following awk script&lt;BR /&gt;&lt;BR /&gt;list="apple:fruit&lt;BR /&gt;      dog:animal"&lt;BR /&gt;&lt;BR /&gt;for i in $list;&lt;BR /&gt;do&lt;BR /&gt;  echo $i |awk -F: '{ vob =$1; vobpath=$2;&lt;BR /&gt;         "unix-command  vob" }'&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;I want to run a unix-command within awk, can it be done?&lt;BR /&gt;&lt;BR /&gt;how do I let the unix command know "vob" is not literal "vob", but a variable?&lt;BR /&gt;&lt;BR /&gt;thank you</description>
      <pubDate>Wed, 08 Feb 2006 15:38:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk-script/m-p/3727279#M100925</guid>
      <dc:creator>Gemini_2</dc:creator>
      <dc:date>2006-02-08T15:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: awk script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk-script/m-p/3727280#M100926</link>
      <description>A quick look at the awk man page reveals there is a system(cmd) function that executes cmd and returns its exit code.</description>
      <pubDate>Wed, 08 Feb 2006 15:45:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk-script/m-p/3727280#M100926</guid>
      <dc:creator>Jeff_Traigle</dc:creator>
      <dc:date>2006-02-08T15:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: awk script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk-script/m-p/3727281#M100927</link>
      <description>Will this work for you ?&lt;BR /&gt;&lt;BR /&gt;# echo "$list" | awk -F: '{print $1,$2}' | xargs -n1 unix-command</description>
      <pubDate>Wed, 08 Feb 2006 15:48:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk-script/m-p/3727281#M100927</guid>
      <dc:creator>Sundar_7</dc:creator>
      <dc:date>2006-02-08T15:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: awk script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk-script/m-p/3727282#M100928</link>
      <description>Why not:&lt;BR /&gt;&lt;BR /&gt;list="apple:fruit&lt;BR /&gt;dog:animal"&lt;BR /&gt;&lt;BR /&gt;for i in `echo $list |awk -F: '{ print $1}'`&lt;BR /&gt;do&lt;BR /&gt;unixcommand $i&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Feb 2006 15:49:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk-script/m-p/3727282#M100928</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2006-02-08T15:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: awk script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk-script/m-p/3727283#M100929</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;I'm not sure exactly what you want to run, but you can do things like this:&lt;BR /&gt;&lt;BR /&gt;# echo "hi:there" |awk -F: '{print $1;system("echo ok|xargs")}'&lt;BR /&gt;&lt;BR /&gt;# echo "hi:there" |awk -F: '{print $1;system("date")}'&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 08 Feb 2006 15:57:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk-script/m-p/3727283#M100929</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-02-08T15:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: awk script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk-script/m-p/3727284#M100930</link>
      <description>I like the system suggestion, other suggestions are also good. But, my unix command has a hard time taking the variable from awk..see below&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;for i in $list;&lt;BR /&gt;do&lt;BR /&gt;  echo $i |awk -F: '{ vob =$1; vobpath=$2;&lt;BR /&gt;         system("cleartool lsvob vob") }'&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;it interpret vob as "vob" instead of a variable...</description>
      <pubDate>Wed, 08 Feb 2006 16:15:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk-script/m-p/3727284#M100930</guid>
      <dc:creator>Gemini_2</dc:creator>
      <dc:date>2006-02-08T16:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: awk script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk-script/m-p/3727285#M100931</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;try this:&lt;BR /&gt;&lt;BR /&gt;for i in $list&lt;BR /&gt;do&lt;BR /&gt;echo $i |awk -F: '{ vob=$1; vobpath=$2;&lt;BR /&gt;system("cleartool lsvob" vob) }'&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Wed, 08 Feb 2006 16:21:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk-script/m-p/3727285#M100931</guid>
      <dc:creator>Andreas Voss</dc:creator>
      <dc:date>2006-02-08T16:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: awk script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk-script/m-p/3727286#M100932</link>
      <description>Hi Gemini:&lt;BR /&gt;&lt;BR /&gt;Here's a better example:&lt;BR /&gt;&lt;BR /&gt;# cat ./runner&lt;BR /&gt;#!/usr/bin/awk -f&lt;BR /&gt;{&lt;BR /&gt;system("echo ok " $1)&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;echo "Gemini" | ./runner&lt;BR /&gt;&lt;BR /&gt;Notice that the command to run and its fixed arguments are enclosed in double quotes.  The variable data is not.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 08 Feb 2006 16:28:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk-script/m-p/3727286#M100932</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-02-08T16:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: awk script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk-script/m-p/3727287#M100933</link>
      <description>Another way:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;list="apple:fruit&lt;BR /&gt; dog:animal"&lt;BR /&gt;&lt;BR /&gt;for i in $list;&lt;BR /&gt;do&lt;BR /&gt; vob=`echo $i |awk -F: '{print $1}'`&lt;BR /&gt; echo $vob&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Feb 2006 17:06:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk-script/m-p/3727287#M100933</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2006-02-08T17:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: awk script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk-script/m-p/3727288#M100934</link>
      <description>thanks for everyone's kind help!&lt;BR /&gt;I got it!&lt;BR /&gt;&lt;BR /&gt;system("cleartool lsvob" vob) }'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I assigned everyone some points!!!!&lt;BR /&gt;&lt;BR /&gt;thank you again!!&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Feb 2006 17:41:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk-script/m-p/3727288#M100934</guid>
      <dc:creator>Gemini_2</dc:creator>
      <dc:date>2006-02-08T17:41:49Z</dc:date>
    </item>
  </channel>
</rss>

