How to associate /opt/local/bin/bash with .bat files

Gregory Shenaut gkshenaut at ucdavis.edu
Tue Jan 28 10:49:12 PST 2014


If you've installed Parallels, .bat files are associated by default with Notepad.app (in the the Windows system). There might be some way to associate them with Windows Console, but I don't know. The “Default Apps” system preference pane might be a good place to start (google it). 

The other thing worth mentioning is to not to forget to set the execute bit on your scripts.

By the way, I personally believe that MacOS's use of file suffixes to define the type of a file is one of its most embarrassing and annoying attributes.

Greg

On Jan 28, 2014, at 06:49 , Arno Hautala <arno at alum.wpi.edu> wrote:

> On Tue, Jan 28, 2014 at 8:40 AM, Clemens Lang <cal at macports.org> wrote:
>> Macs (and other Unix systems) don't associate files and their
>> interpreters based on the filename extension. Only windows uses this
>> method.
> 
> That's not entirely true. Macs used to use File Type and Creator codes
> to associate files and in those days extensions weren't required on
> file names. These attributes are still visible via commands like
> GetFileInfo. Their use is certainly deprecated and I wouldn't be
> surprised if it isn't consulted at all in current versions of OS X.
> Seems that as of 10.6 they're ignored in favor of Uniform Type
> Identifiers: http://en.wikipedia.org/wiki/Creator_code
> 
> I'm fairly sure that the current mix of UTI and extension mapping is a
> mess though. At least, it seemed to be the last time I looked into it.
> That's another thread though.
> 
> These days, if you Get Info on a file (select the file in the Finder
> and use Command-I or File > Get Info) there is a section labeled "Open
> With". You can select an application from the list or explicitly
> browse to some other application. When changing the selection, there's
> a button to "Change All". Pressing that will prompt to associate "all
> files with extension '.bat'" with the new application. Some extensions
> are associated with known types, and some files are marked with UTIs,
> and will instead ask if you want to associate, for example, all "text
> files" instead of listing ".txt".
> 
> In your case though, you wouldn't want to associate a ".bat" or ".sh"
> file with bash, you'd want to set it to be opened by "Terminal.app".
> You can then edit the shebang line to set which shell should be used
> to interpret the script, as indicated by Clemens.
> 
> -- 
> arno  s  hautala    /-|   arno at alum.wpi.edu
> 
> pgp b2c9d448
> _______________________________________________
> macports-users mailing list
> macports-users at lists.macosforge.org
> https://lists.macosforge.org/mailman/listinfo/macports-users



More information about the macports-users mailing list