Link to home
Start Free TrialLog in
Avatar of reach_gururaj
reach_gururaj

asked on

Counting charcters

Hi all,

I am learning shell scripts. I need to do some
validations. TO do that I need to count the chars in a
given word. Could you help me in that ?

1) Accept the word from user ( I can do this :))

2) count the characters in the given word and store the
number in a variable.

3) Display the content of the variable ?

wc -c counts including end of the line or word char. How
to avoid this ?

I am using sun solaris 5.8


Thanks in advance
Gururaj
ASKER CERTIFIED SOLUTION
Avatar of bira
bira

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of reach_gururaj
reach_gururaj

ASKER

Thanks bira.