Counting characters with unix utilities

Edward Vielmetti emv at math.lsa.umich.edu
Tue Sep 25 07:54:37 AEST 1990


In article <TED.90Sep24090053 at kythera.nmsu.edu> ted at nmsu.edu (Ted Dunning) writes:

      cat file | tr -cd 'A' | wc -c

   ed must have been kidding when he left the cat in place, instead of
   tr -cd 'A' < file | wc -c

nope.  I cat files all the time.  That way when I go back to edit this command
to work on the output of a command instead of the contents of a file
there's no extra work or thinking involved.

      grep ^Subject file | tr -cd 'A' | wc -c

--Ed

Edward Vielmetti, U of Michigan math dept <emv at math.lsa.umich.edu>
moderator, comp.archives

"No funding, no fixing."



More information about the Comp.unix.questions mailing list