<p>Given a <a href='http://samtools.sourceforge.net/SAM1.pdf'>sam</a> file which was produced by using <a href='http://bio-bwa.sourceforge.net/'>bwa</a> to align a fastq of reads to a reference genome, how can I enumerate the number of reads which were assigned to each chromosome of the reference genome?</p>

based on the first column only:

    awk ' $1 !~ /@/ {print $1}' toy.sam | uniq -c

if you want to count only aligned reads you can also use awk to count only aligned reads.