I’ve wanted IDL batch files to be executable scripts for awhile, but figured I would just have to live without that since IDL’s comment character is not #. But then found out that Scheme also uses the ; as the comment characters, but allows the first line to begin with #! (the shebang) and just ignores that line. So I made rIDL mimic that:

$ mg_shebang_test.pro
This is an executable rIDL script!

where the mg_shebang_test.pro script is:

#!/usr/bin/env ridl -quiet
; This is an example of an executable rIDL script that recognizes the shebang
; characters, #!, on the first line of the script.
print, 'This is an executable rIDL script!'

This was actually quite simple to add to rIDL; I would love to see this feature in regular command line IDL.