Would any aligner give a result like this:
GGGGGGGGG 6 chr13 - 72592620 72592644 1
GGGGGGGGG 6 chr14 - 46332831 46332855 1
identical sequence, but different aligned position ... that seems like that would only happen if the sequence is non-uniquely mapped, and the sequence is assigned at random. In that case, listing this kind of thing multiple times might be deceptive for some applications.
This is started out as a comment, but I will try to answer your question. I can't think of anything that doesn't involve wiring a program or a script or both.
My first idea would be to write a script that directly translates your SAM to a BED. In python, I would make a first pass through my SAM and store all of the sequences in a dictionary with the sequence as the key, and the counts of the sequence as the value.
Then I would make a second pass through my SAM file and translate it directly to BED format. I have asked a lot of questions on Biostar about how to get information about where sequences are mapped SAM, so searching on biostar should be enough to put the whole story together.
My second idea is find a program that can translate SAM to BED with the sequence in the name field of the BED. I don't know any that do this, but perhaps there is one out there. Then use a unix trick to sort and count, like "uniq -c"
If you can't find a program that translates directly to BED in the way you want, and you don't want to write on yourself, then ttake your SAM and filter for only the mapped reads using samtools.
samtools view -S -F0x4 input.sam > filtered.sam
Convert your SAM to BED with samtools and bedtools
samtools -b -S filtered.sam > filtered.bam
bamToBed -i filtered.bam > filtered.bed
I think both the filtered.bed file and the filtered.sam file should have the same number of lines and information for each tag in the same order. This is a guess and could be wrong. Anyway, from here you should be able to merge the information in these files using awk or something like that to bed a bed file with the sequence in the name field.
Finally you can use
uniq -c as mentioned above.