Subtracting, the old-fashioned way
sed 144

Most of you will know this little episode from roman times, when Cesar invented the Cesar crypting (aka rot13) using SED. 

As a big fanatic of SED, he printed the most common used commands: substitute, print, quit and read (SPQR) on signs which he carried with him to teach his soldiers the use of SED. 

#  63 = sed-file
#  81 = this
# 144 summa summarum
tac a|rev|sed y/gs/sg/ &gt;b
echo $1|sed -f a|sed "s/$(echo $2|sed -f a)//"|sed -f b


first version 181:

# 126 = 2 sed-files =126
#  55 = this
# 181 summa summarum 
echo $1|sed -f a|sed "s/$(echo $2|sed -f a)//"|sed -f b


2 files to use which count to the solution:

a: 

s/M/DD/g
s/D/CCCCC/g
s/C/LL/g
s/L/XXXXX/g
s/X/VV/g
s/V/IIIII/g


b:

s/IIIII/V/g
s/VV/X/g
s/XXXXX/L/g
s/LL/C/g
s/CCCCC/D/g
s/DD/M/g


but b can be produced with the first line of the new solution from a: it is - more or less - the inverse, and so we read the file from bottom to top (tac) and from right to left (rev), and switch s and g which are now in the wrong order.

Invocation: 

./cg-6061-roman-minus.sh MDCCCCLXV LXVI 
MDCCCLXXXXVIIII


I guess I can golf this further, but I liked to occupy wallstreet the sed slot. :)

Since the logic isn't only in the sed files, but in the invocation too, I sum it all up. It could be argued about echo $1, but what about the nested $2? Let's just sum it together. 

The sedfiles are pretty long and very redundant in their structure. There seems to be room for optimization. 

Luckily, the romans already had QVANTVM &lt;OMPVTVVMZ, so they didn't care for the otherwise lousy performance. 

tl;dr:

I convert both numbers into church numerals (IIIIII=6), remove the second from the first, and reconvert the result back. 

s.e.d. - sod errat demonstrandum.