Thanks for using BEDOPS. I think you're looking for what the 'bedmap' program does.
I'm not very familiar with BedTools, but looking quickly at the documentation, the intersectBed command appears to give the same region from $ref as many times as there are qualified overlapping elements in $db. The -u option skips elements from $ref that have no overlapping elements.
The bedops -e (--element-of) is a set operation that gives back the elements of $ref that have qualified overlapping elements in $db. That is, the subset of elements in $ref that have overlapping elements in $db. Each element is reported at most 1 time (it is an element of or not an element of the regions found in $db).
The bedmap program in BEDOPS seems to be more analogous to the output of intersectBed in this case.
bedmap --fraction-ref 0.75 --echo --echo-map --skip-unmapped $ref $db
--skip-unmapped causes no output in cases where $ref has no qualifyied overlapping element in $db (this option is available in BEDOPS 2.3). --echo will spit out elements from $ref, while --echo-map spits out all qualified overlapping elements in $db.
The default output format will be different from that in BedTools, and might look something like:
chr1 1 100 ref-file 0.567 +|chr1 2 400 id-A 10;chr1 20 100 id-B 20
in contrast to BedTools
chr1 1 100 ref-file 0.567 + chr1 2 400 id-A 10
chr1 1 100 ref-file 0.567 + chr1 20 100 id-B 20
By default, bedmap separates output columns using the '|' symbol. You can change this with the --delim option. Elements from --echo-map are separated further by the ';' symbol, which you can change with the --multidelim option.
The program accepts options in any order and respects the order given on output, so that:
'bedmap --skip-unmapped --echo-map --echo $ref $db'
swaps the output columns. bedmap offers a rich set of overlap options. Above, I use --fraction-ref, but --fraction-map, --fraction-either, and --fraction-both are all popular alternative options.
If you are just interested in the IDs or the scores in $db, you could use --echo-map-id or --echo-map-score. Many other options are available. See docs and bedmap --help for details.
By default, bedmap does no input error checking so you might consider using --ec while you're getting used to the program (slows it down by half).
Let us know if I've read the BedTools' documentation incorrectly or if you have any more questions.