Linux: Possible To Script Midi Data?

just had an idea totally unrelated to Renoise, but would like to tap into the knowledge floating around these forums.

would it be possible to write a script in Linux that sends midi data to somewhere? so literally do something like this (mockup, for example only):

  
echo "093C80" > live_midi_input_something  
  

(i think 09 is hex for note-on, 3C should be the middle C and 80 the velocity. this could all be very wrong)

using hex in this example, but it might be binary or numeral or whatever. for scripting, can be bash, python, perl, whatever. just wondering what the possibilities for this are.

well, either no-one knows or no-one cares :)
to do a sorta-bump, just read this stuff on CDM. it isn’t MIDI data but might check this out anyway.
http://createdigitalmusic.com/2011/10/music-from-code-in-simple-text-live-coding-steve-reich-ian-rhythms-with-free-overtone
http://createdigitalmusic.com/2011/10/entire-musical-compositions-made-from-just-one-line-of-code-are-glitchy-but-musical