The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
specified word count bhaviknp Shell Programming and Scripting 5 02-27-2008 11:23 AM
search& count for the occurence of a word skoppana UNIX for Dummies Questions & Answers 1 11-09-2007 05:07 PM
Word count problem ssmith001 UNIX for Dummies Questions & Answers 1 01-02-2007 01:21 PM
count word ariuscy UNIX for Dummies Questions & Answers 1 10-13-2005 12:36 AM
How do I count # of char. in a word? xadamz23 Shell Programming and Scripting 9 11-12-2003 12:19 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-24-2005
chaandana chaandana is offline
Registered User
  
 

Join Date: Mar 2005
Posts: 49
word count wc

could someone explain this please.

echo aaaa|wc -c
5
echo aaaa|wc -m
5

But I'd expect the count to be 4

Its SunOS 5.8

Thanks in Advance.
  #2 (permalink)  
Old 07-24-2005
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
Interesting. Does the same thing in Solaris 2.6, and 9, and Fedora too.
  #3 (permalink)  
Old 07-25-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
This is starting to be a faq...

Finding out the length of a string held within a variable
wc -c
length of the string
  #4 (permalink)  
Old 07-25-2005
chaandana chaandana is offline
Registered User
  
 

Join Date: Mar 2005
Posts: 49
Thanks for your input!

Pretty simple but made complex.
wc man page should get an update.

Cheers!
  #5 (permalink)  
Old 07-25-2005
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,796
Quote:
Originally Posted by chaandana
Thanks for your input!

Pretty simple but made complex.
wc man page should get an update.

Cheers!
Instead of man wc, check out

Code:
info wc
contains those information.

Vino
  #6 (permalink)  
Old 05-05-2009
HernandJ2 HernandJ2 is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 5
Post

Quote:
Originally Posted by chaandana View Post
could someone explain this please.

echo aaaa|wc -c
5
echo aaaa|wc -m
5

But I'd expect the count to be 4

Its SunOS 5.8

Thanks in Advance.

I belive is counting the end Character. If you do:

echo | wc -c
1

echo| wc -c
1
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:58 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0