<?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 Basic Question on WC in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/basic-question-on-wc/m-p/3847362#M777119</link>
    <description>Prompt&amp;gt;echo 'hello' | wc -c&lt;BR /&gt;       6&lt;BR /&gt;Prompt&amp;gt;echo 'hello' | wc -m&lt;BR /&gt;       6&lt;BR /&gt;Prompt&amp;gt;echo 'test' | wc -m&lt;BR /&gt;       5&lt;BR /&gt;Prompt&amp;gt;echo test | wc -m&lt;BR /&gt;       5&lt;BR /&gt;Prompt&amp;gt;echo test|wc -m&lt;BR /&gt;       5&lt;BR /&gt;Prompt&amp;gt;echo test|wc -C&lt;BR /&gt;       5&lt;BR /&gt;&lt;BR /&gt;i'm expecting 5 characters for hello and 4 for test  !!! what am i missing  ? &lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 21 Aug 2006 10:14:12 GMT</pubDate>
    <dc:creator>uform</dc:creator>
    <dc:date>2006-08-21T10:14:12Z</dc:date>
    <item>
      <title>Basic Question on WC</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/basic-question-on-wc/m-p/3847362#M777119</link>
      <description>Prompt&amp;gt;echo 'hello' | wc -c&lt;BR /&gt;       6&lt;BR /&gt;Prompt&amp;gt;echo 'hello' | wc -m&lt;BR /&gt;       6&lt;BR /&gt;Prompt&amp;gt;echo 'test' | wc -m&lt;BR /&gt;       5&lt;BR /&gt;Prompt&amp;gt;echo test | wc -m&lt;BR /&gt;       5&lt;BR /&gt;Prompt&amp;gt;echo test|wc -m&lt;BR /&gt;       5&lt;BR /&gt;Prompt&amp;gt;echo test|wc -C&lt;BR /&gt;       5&lt;BR /&gt;&lt;BR /&gt;i'm expecting 5 characters for hello and 4 for test  !!! what am i missing  ? &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 21 Aug 2006 10:14:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/basic-question-on-wc/m-p/3847362#M777119</guid>
      <dc:creator>uform</dc:creator>
      <dc:date>2006-08-21T10:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Question on WC</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/basic-question-on-wc/m-p/3847363#M777120</link>
      <description>There is the additional carriage return character that gets counted as far as I recall</description>
      <pubDate>Mon, 21 Aug 2006 10:17:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/basic-question-on-wc/m-p/3847363#M777120</guid>
      <dc:creator>melvyn burnard</dc:creator>
      <dc:date>2006-08-21T10:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Question on WC</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/basic-question-on-wc/m-p/3847364#M777121</link>
      <description>Hi,&lt;BR /&gt;man wc&lt;BR /&gt;"A word is a string of characters delimited by spaces, tabs, or newlines."&lt;BR /&gt;&lt;BR /&gt;It the newline char at the end:&lt;BR /&gt;echo hello | wc -l&lt;BR /&gt;1</description>
      <pubDate>Mon, 21 Aug 2006 10:18:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/basic-question-on-wc/m-p/3847364#M777121</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-08-21T10:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Question on WC</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/basic-question-on-wc/m-p/3847365#M777122</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;The newline character is counted.  You can see visually what Melvyn refers to by doing:&lt;BR /&gt;&lt;BR /&gt;# echo hello|cat -etv&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 21 Aug 2006 10:20:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/basic-question-on-wc/m-p/3847365#M777122</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-08-21T10:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Question on WC</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/basic-question-on-wc/m-p/3847366#M777123</link>
      <description>Here is an alternative method:&lt;BR /&gt;&lt;BR /&gt;expr length $(echo "hello")&lt;BR /&gt;</description>
      <pubDate>Mon, 21 Aug 2006 10:27:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/basic-question-on-wc/m-p/3847366#M777123</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-08-21T10:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Question on WC</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/basic-question-on-wc/m-p/3847367#M777124</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;if you just need the length of a string:&lt;BR /&gt;&lt;BR /&gt;a=hello&lt;BR /&gt;print ${#a}&lt;BR /&gt;&lt;BR /&gt;No additional newline needs to be considered.&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Mon, 21 Aug 2006 10:39:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/basic-question-on-wc/m-p/3847367#M777124</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-08-21T10:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Question on WC</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/basic-question-on-wc/m-p/3847368#M777125</link>
      <description>ok thanks all.</description>
      <pubDate>Mon, 21 Aug 2006 10:44:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/basic-question-on-wc/m-p/3847368#M777125</guid>
      <dc:creator>uform</dc:creator>
      <dc:date>2006-08-21T10:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Question on WC</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/basic-question-on-wc/m-p/3847369#M777126</link>
      <description>You could also put a \c at the end of the echo to supress the newline:&lt;BR /&gt;&lt;BR /&gt;fifejj:/&amp;gt; echo "test\c" | wc -m&lt;BR /&gt;4&lt;BR /&gt;fifejj:/&amp;gt; echo "hello\c" | wc -m&lt;BR /&gt;5&lt;BR /&gt;fifejj:/&amp;gt; mystring=hello&lt;BR /&gt;fifejj:/&amp;gt; echo "${mystring}\c" | wc -m&lt;BR /&gt;5&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 21 Aug 2006 10:45:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/basic-question-on-wc/m-p/3847369#M777126</guid>
      <dc:creator>Jonathan Fife</dc:creator>
      <dc:date>2006-08-21T10:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Question on WC</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/basic-question-on-wc/m-p/3847370#M777127</link>
      <description>wc is also counting the newline character written as \n...for example:&lt;BR /&gt;&lt;BR /&gt;# echo hello | od -c&lt;BR /&gt;# echo test | od -c&lt;BR /&gt;&lt;BR /&gt;cheers!</description>
      <pubDate>Mon, 21 Aug 2006 10:50:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/basic-question-on-wc/m-p/3847370#M777127</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-08-21T10:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Question on WC</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/basic-question-on-wc/m-p/3847371#M777128</link>
      <description># echo 'hello' | awk '{print length}'&lt;BR /&gt;5&lt;BR /&gt;</description>
      <pubDate>Mon, 21 Aug 2006 10:53:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/basic-question-on-wc/m-p/3847371#M777128</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2006-08-21T10:53:04Z</dc:date>
    </item>
  </channel>
</rss>

