![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| word count wc | chaandana | UNIX for Dummies Questions & Answers | 5 | 05-05-2009 11:47 AM |
| specified word count | bhaviknp | Shell Programming and Scripting | 5 | 02-27-2008 11:23 AM |
| how to count pariticular char in a location in a file | arunkumar_mca | UNIX for Dummies Questions & Answers | 5 | 07-18-2007 12:40 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 01:36 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How do I count # of char. in a word?
I havent done shell scripting in quite some time. I want to know how to count the number of characters in a word, specifically a parameter.
Example: myscript hello I want "myscript" to return the number of charcaters in the parameter "hello". Any ideas? |
|
||||
|
please read the rules. no homework questions.
the class might not cover a command but you can bet your $$ that the teacher covered the material needed in class or as a reading assignment. man wc. |
|
||||
|
to tell you the truth i am unsure what the 6th byte is. never noticed it before. the only thing i can think of is this snipit from the environ(5) man page. anyone else have any insite into why wc counts more 1 more charicter or byte then is in the file? Code:
LC_CTYPE
This category specifies character classifica-
tion, character conversion, and widths of multi-
byte characters. When LC_CTYPE is set to a
valid value, the calling utility can display and
handle text and file names containing valid
characters for that locale; Extended Unix Code
(EUC) characters where any individual character
can be 1, 2, or 3 bytes wide; and EUC characters
of 1, 2, or 3 column widths. The default "C"
locale corresponds to the 7-bit ASCII character
set; only characters from ISO 8859-1 are valid.
The information corresponding to this category
is stored in a database created by the
localedef() command. This environment variable
is used by ctype(3C), mblen(3C), and many com-
mands, such as cat(1), ed(1), ls(1), and vi(1).
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|