Find the answer to your Linux question:
Results 1 to 3 of 3
I've been read an article describe cksum, like this 'cksum computes a cyclic redundancy check (CRC) checksum for each given file, or standard input'. and also about one char is ...
  1. #1
    Just Joined!
    Join Date
    Jun 2010
    Posts
    8

    cksum

    I've been read an article describe cksum, like this
    'cksum computes a cyclic redundancy check (CRC) checksum for each given file, or standard input'.
    and also about one char is one byte.
    But when execute cksum like this
    Code:
    echo are | cksum
    and the output
    Code:
    2979220839 4
    why output is 4, I think 'are' have 3 byte.

  2. #2
    drl
    drl is offline
    Linux Engineer drl's Avatar
    Join Date
    Apr 2006
    Location
    Saint Paul, MN, USA / CentOS, Debian, Solaris, SuSE
    Posts
    1,117
    Hi.
    Code:
    % echo are | od -bc
    0000000 141 162 145 012
              a   r   e  \n
    The newline character (LF, linefeed, 12b) is added to the string by echo ... cheers, drl
    Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
    90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
    We look forward to helping you with the challenge of the other 10%.
    ( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )

  3. #3
    Just Joined!
    Join Date
    Jun 2010
    Posts
    8
    Oh my God, I forgot you "newline".
    Yeah its great newline has been added by echo, and when i use -n option in echo, the output is 3.
    Thankyou very much.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...