Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: wc -c  (Read 6847 times)

0 Members and 1 Guest are viewing this topic.

billrich

  • Guest
wc -c
« on: June 11, 2009, 07:36:08 PM »
$cat  saywhat.bat

Code: [Select]
cat unix.txt

wc -c  unix.txt

type  unix.txt
mwc.bat

cat unix.txt

wc -c  unix.txt

$ saywhat.bat
$cat unix.txt
666666
$wc -c  unix.txt
       6   unix.txt

$type  unix.txt
666666
$mwc.bat

$cat unix.txt
666666
$wc -c  unix.txt
       6   unix.txt
$
« Last Edit: June 12, 2009, 02:42:05 PM by billrich »

Rob Pomeroy



    Prodigy

  • Systems Architect
  • Thanked: 124
    • Me
  • Experience: Expert
  • OS: Other
Re: wc -c
« Reply #1 on: June 12, 2009, 02:58:51 AM »
Maybe it's counting carriage return, line feed and end of file "characters"?  You're showing this at a Windows style C: prompt - what version of wc is this?
Only able to visit the forums sporadically, sorry.

Geek & Dummy - honest news, reviews and howtos

billrich

  • Guest
Re: wc -c
« Reply #2 on: June 12, 2009, 04:19:33 AM »
Maybe it's counting carriage return, line feed and end of file "characters"?  You're showing this at a Windows style C: prompt - what version of wc is this?

MKS C Tools for windows  from about 1985.  I don't know the version.

http://www.mkssoftware.com/reskit/


Rob Pomeroy



    Prodigy

  • Systems Architect
  • Thanked: 124
    • Me
  • Experience: Expert
  • OS: Other
Re: wc -c
« Reply #3 on: June 12, 2009, 05:10:24 AM »
I'm kind of confused that this is in the Linux forum...

Anyway, I suspect my answer as above is correct.  Try a few similar files with one line of different lengths - do you always get the 3 ghost characters counted?
Only able to visit the forums sporadically, sorry.

Geek & Dummy - honest news, reviews and howtos

Aegis



    Expert

    Thanked: 67
    • Yes
    • Yes
    • Brian's Mess Of A Web Page
  • Experience: Experienced
  • OS: Windows 10
Re: wc -c
« Reply #4 on: June 12, 2009, 05:20:58 AM »
From an IBM AIX page, wc -c counts bytes unless the -k flag is added.

I know that's not the same software, but it supports the idea that wc is counting something besides the actual printed characters.


"For you, a thousand times over." - "The Kite Runner"

gh0std0g74



    Apprentice

    Thanked: 37
    Re: wc -c
    « Reply #5 on: June 12, 2009, 05:58:25 AM »
    i have showed bill why here

    Rob Pomeroy



      Prodigy

    • Systems Architect
    • Thanked: 124
      • Me
    • Experience: Expert
    • OS: Other
    Re: wc -c
    « Reply #6 on: June 12, 2009, 06:16:59 AM »
    I'm seeing a lot of great minds thinking alike here (plus my rather dull mind).
    Only able to visit the forums sporadically, sorry.

    Geek & Dummy - honest news, reviews and howtos

    billrich

    • Guest
    Re: wc -c
    « Reply #7 on: June 12, 2009, 11:08:19 AM »
    Quote
    author=Rob Pomeroy link=topic=85331.msg570124#msg570124 date=1244805024]
    I'm kind of confused that this is in the Linux forum...

    wc is a command for linux and unix and windows

    « Last Edit: June 12, 2009, 04:49:03 PM by billrich »

    Rob Pomeroy



      Prodigy

    • Systems Architect
    • Thanked: 124
      • Me
    • Experience: Expert
    • OS: Other
    Re: wc -c
    « Reply #8 on: June 12, 2009, 12:30:49 PM »
    Er, yes, I know what wc is...  I was just a bit thrown by the C: prompt.  Presumably this is running under GnuWin32 or something like that.  Of course as the recursive acronym goes, "Gnu's Not Unix".  ;)
    Only able to visit the forums sporadically, sorry.

    Geek & Dummy - honest news, reviews and howtos

    billrich

    • Guest
    Re: wc -c
    « Reply #9 on: June 12, 2009, 02:39:09 PM »
    Er, yes, I know what wc is...  I was just a bit thrown by the C: prompt.  Presumably this is running under GnuWin32 or something like that.  Of course as the recursive acronym goes, "Gnu's Not Unix".  ;)

    Here at Hope "expertise" is gained by the number of posts and not by our knowledge of the subject.  It much the same as the U.S. Congress. The top positions are assigned by seniority  and not knowledge or accomplishments.

    Rob Pomeroy



      Prodigy

    • Systems Architect
    • Thanked: 124
      • Me
    • Experience: Expert
    • OS: Other
    Re: wc -c
    « Reply #10 on: June 12, 2009, 03:04:39 PM »
    Come again?
    Only able to visit the forums sporadically, sorry.

    Geek & Dummy - honest news, reviews and howtos

    Aegis



      Expert

      Thanked: 67
      • Yes
      • Yes
      • Brian's Mess Of A Web Page
    • Experience: Experienced
    • OS: Windows 10
    Re: wc -c
    « Reply #11 on: June 12, 2009, 03:21:02 PM »
    I'd just as well the Star Trek ranks from the first of April were still in place.  Our forum ranks may signal levels of expertise, but most of us are known by the advice we give:  Patio and Broni for all 'round expertise, evilfantasy for malware expertise, kpac for web page knowledge, and several for batch file expertise.  (I leave out many names, and I apologize.)  

    Me?  Well, I try to throw out some pertinent questions every now and then, and I'm really good at recommending you not flash the BIOS of your computer -- unless it's absolutely a last resort -- and I'm not sure I like it, even then!   :)

    Sure, I like that I rank "Specialist," and that i'll have another in less than one hundred posts, but if someone were to ask if I consider myself a computer specialist, I'd emphatically say, "No."

    The long and short of it, is that most of us do not act, or portray ourselves, outside our areas, or above our levels, of expertise.


    "For you, a thousand times over." - "The Kite Runner"

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: wc -c
    « Reply #12 on: June 12, 2009, 08:29:22 PM »
    I'm confused at the sudden change of topic...


    Quote
    and several for batch file expertise.  (I leave out many names, and I apologize.) 

    And of course, BC_Programmer for being modest and knowing everything.

    HA HA HA

    just kidding of course. I'm not that modest.
    I was trying to dereference Null Pointers before it was cool.