Finder shows executable shell scripts as Unix binaries

bashfinderscript

I am writing and using many shell scripts (bash) on my mac. One issue has been bugging me for a while. When I look at the scripts in the Finder, they come up as "Unix Binaries". If I tag a file type (.sh) then the finder recognizes them as shell scripts.

enter image description here

If I tag a file type (.sh) then the finder recognizes it as shell script:

enter image description here

If I make the shell script file (without extension) non-executable (chmod -x) then the finder recognizes it as a text file. It looks like the finder thinks that any executable file without any extension is de-facto a Unix binary executable. I thought the finder was peeking at a file content to determine its nature ? Is there a way to control that ?

Best Answer

This all seems correct.

Under Unix the only way any file is executable is if the executable bit is set in the file modes.

There is no such thing as a binary executable just executable and it does not matter what the file is script or compiled