The following process will give you a command which you can run to
help debug commands:
1) Create a Command in the Bundle Editor called "Command Output"
2) Paste the following script into the Bundle Editor:
print while gets
print "END OF STDIN\n"
print `env | sort`
3) Set Input to Selected Text or Scope
4) Set Output to Show as HTML
5) Set the scope to whatever scope you want to use in your command
Try it out. It will dump the input followed by a divider followed by
the entire environment supplied to the command.
I used this to determine what TextMate was supplying to the Command I
Show replies by date