OSX 'open with' bash script
It's not possible. Launch Services works with application identifiers, and bash scripts don't have them.
You need to create a wrapper application using Automator.
- Launch Automator
- Select Application
- Look for the Run Shell Script action and add it to the right.
- Pass input as arguments
- Put your script in there
- Save somewhere
Here's my version, using the Growl command line utility:
Result:
You can see the effect this change has on ~/Library/Preferences/com.apple.LaunchServices.plist
when you Change All:
("Test" is the name I gave my Automator application)