Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Confusion with the concept of wc -c and wc -m Post 302917340 by shellscripting on Tuesday 16th of September 2014 07:27:46 AM
Old 09-16-2014
Confusion with the concept of wc -c and wc -m

Is wc -c and wc -m same ?

Code:
Shellscript::cat file1 
hello
Shellscript::cat file1 | wc -c
6
Shellscript::cat file1 | wc -m
6
Shellscript::file file1
file1: ASCII text
Shellscript::uname -a
Linux was85host 2.6.27.45-0.1-vmi #1 SMP 2010-02-22 16:49:47 +0100 i686 i686 i386 GNU/Linux

Atleast for wc -m i was expecting the result to be 5 as it calculates the number of characters and not bytes.

wc -c shows 6. Is 1 character not 1 byte in Ascii system ?

Thanks,
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

semaphore concept

Hi All, I am going through the semaphore concept and have a doubt regarding the same and hope to get a resolution here. I have a file which has a number of records. I want to write an application (in C) which will be able to do concurrent read/write on these records. Of what I have... (8 Replies)
Discussion started by: maverix
8 Replies

2. UNIX for Dummies Questions & Answers

The Concept of thread

Hi all This is my first thread here.i confused with the concept of thread.Can anyone tell me this concept in detail.my Quation may be at primary level. Thanx in advance for help. (1 Reply)
Discussion started by: vishwasrao
1 Replies

3. UNIX for Dummies Questions & Answers

about concept of Interrupts.

Hi all, I am new here ,i want to know about interrupts in detail.What r Interrupts .how they r handeled. Thanx in adavnce. (1 Reply)
Discussion started by: vishwasrao
1 Replies

4. Shell Programming and Scripting

Concept Of Array

Hi all, I used array a lot in C,VB,C# and java but now i am very new to shell programming,so i need a start of array in shell programming. All i want to do is read a string and put it into a character type array. For reading the string,i did this: $ read a now i want to put the content of a... (1 Reply)
Discussion started by: gautamshaw
1 Replies

5. AIX

Use of mirroring concept....

hi.... Friends... Why using mirroring ? what is the use of mirroring? just any one tell about clearly.... thanks.... (4 Replies)
Discussion started by: Kannan841
4 Replies

6. UNIX for Dummies Questions & Answers

help me in RAID concept...

i couldn't get what does the metainit command represents in numeric values. (i.e) #metainit d66 2 1 c0t0d0s4 1 c0t0d0s5 ??here 2 1 1 represnts what ?? can some one tell clearly about this... (6 Replies)
Discussion started by: sriniv666
6 Replies

7. UNIX for Advanced & Expert Users

Looping concept please help

Hi Gurus, Please help me in below requirement. Instance =5 (it is user parameter) total=52 (it is user parameter i need to split this to 5 and reminder as 1 instances totally 6 for example i need to splitt to each 52/5=10.4 1-10 11-20 21-30 31-40 41-50 (2 Replies)
Discussion started by: ragu.selvaraj
2 Replies

8. UNIX for Dummies Questions & Answers

ACL concept

Hi.. Could someone explain about setfacl,getfacl in unix and its uses. Regards, Suresh (1 Reply)
Discussion started by: suresh sunkara
1 Replies

9. UNIX for Dummies Questions & Answers

Sort concept confusion

By default, sort reorders lines in ASCII collating sequence --- whitespace first, then numerals,uppercase letters and finally lowercase letters. Shellscript:cat sort.txt aaa bbb ddd AAA eee GGG ggg Shellscript:sort sort.txt aaa AAA bbb ddd eee ggg GGG Why the default output... (6 Replies)
Discussion started by: shellscripting
6 Replies
All times are GMT -4. The time now is 09:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy