<?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: awk with two variables in sh script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-with-two-variables-in-sh-script/m-p/2988335#M923924</link>
    <description>&lt;BR /&gt;If you want to work with a list of strings on stdin, then follow this model:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;while read string&lt;BR /&gt;do&lt;BR /&gt;length=${#string}&lt;BR /&gt;echo $length $string&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 06 Jun 2003 21:14:46 GMT</pubDate>
    <dc:creator>Jordan Bean</dc:creator>
    <dc:date>2003-06-06T21:14:46Z</dc:date>
    <item>
      <title>awk with two variables in sh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-with-two-variables-in-sh-script/m-p/2988329#M923918</link>
      <description>Must use sh!&lt;BR /&gt;As $1 i get a string with variable stringlength.&lt;BR /&gt;With awk '{print length($1)}' i want to get the stringlength of $1 in an variable like bl.&lt;BR /&gt;This variable has to be used in the script.&lt;BR /&gt;How the variable can be used from stdin?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 04 Jun 2003 08:44:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-with-two-variables-in-sh-script/m-p/2988329#M923918</guid>
      <dc:creator>Bernd Dittmar</dc:creator>
      <dc:date>2003-06-04T08:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: awk with two variables in sh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-with-two-variables-in-sh-script/m-p/2988330#M923919</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;echo $1&lt;BR /&gt;bl=$(echo $1 | awk "{print length(\"$1\")}")&lt;BR /&gt;echo $bl&lt;BR /&gt;&lt;BR /&gt;good luck,&lt;BR /&gt;Thierry.&lt;BR /&gt;</description>
      <pubDate>Wed, 04 Jun 2003 08:58:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-with-two-variables-in-sh-script/m-p/2988330#M923919</guid>
      <dc:creator>Thierry Poels_1</dc:creator>
      <dc:date>2003-06-04T08:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: awk with two variables in sh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-with-two-variables-in-sh-script/m-p/2988331#M923920</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I wouldn't use awk in this case :&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;L=${#1}&lt;BR /&gt;echo "length of '$1' is $L"&lt;BR /&gt;&lt;BR /&gt;would be easier ...&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Wed, 04 Jun 2003 09:10:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-with-two-variables-in-sh-script/m-p/2988331#M923920</guid>
      <dc:creator>Jean-Louis Phelix</dc:creator>
      <dc:date>2003-06-04T09:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: awk with two variables in sh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-with-two-variables-in-sh-script/m-p/2988332#M923921</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;typeset -i length=$(echo $1|wc -c)-1&lt;BR /&gt;echo $length&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;length is then the integer value of the string length of $1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;              Steve Steel</description>
      <pubDate>Wed, 04 Jun 2003 09:58:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-with-two-variables-in-sh-script/m-p/2988332#M923921</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2003-06-04T09:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: awk with two variables in sh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-with-two-variables-in-sh-script/m-p/2988333#M923922</link>
      <description>Bernd... sounds like homework&lt;BR /&gt;and if you NEED to use awk:&lt;BR /&gt;&lt;BR /&gt;string=$1&lt;BR /&gt;bl=$(echo $string | awk '{print $1}' | wc -m)&lt;BR /&gt;echo $bl&lt;BR /&gt;&lt;BR /&gt;of course this can be done without awk completely&lt;BR /&gt;&lt;BR /&gt;bl=$(echo $1 | wc -m)&lt;BR /&gt;</description>
      <pubDate>Wed, 04 Jun 2003 10:13:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-with-two-variables-in-sh-script/m-p/2988333#M923922</guid>
      <dc:creator>John Meissner</dc:creator>
      <dc:date>2003-06-04T10:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: awk with two variables in sh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-with-two-variables-in-sh-script/m-p/2988334#M923923</link>
      <description>Try the following  . . .&lt;BR /&gt;&lt;BR /&gt;let c=$(echo $1 | wc -m)-1&lt;BR /&gt;&lt;BR /&gt;= Mike = &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 06 Jun 2003 17:00:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-with-two-variables-in-sh-script/m-p/2988334#M923923</guid>
      <dc:creator>Mike Miller_8</dc:creator>
      <dc:date>2003-06-06T17:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: awk with two variables in sh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-with-two-variables-in-sh-script/m-p/2988335#M923924</link>
      <description>&lt;BR /&gt;If you want to work with a list of strings on stdin, then follow this model:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;while read string&lt;BR /&gt;do&lt;BR /&gt;length=${#string}&lt;BR /&gt;echo $length $string&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 06 Jun 2003 21:14:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-with-two-variables-in-sh-script/m-p/2988335#M923924</guid>
      <dc:creator>Jordan Bean</dc:creator>
      <dc:date>2003-06-06T21:14:46Z</dc:date>
    </item>
  </channel>
</rss>

