Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

msys2 set executable permission so that commands auto-complete

Tags:

msys2

I would like to be able to do the equivalent of chmod +x file.sh on msys2. This would appear to be possible in some way, since executable files that I have checked out of git have a "+x" permission. But new files that I create for myself do not.

I have read answers such as this: Msys shell command to change the attributes of a file

I realise that msys2 is minimal and does not directly map permissions to windows ones, and that the "+x" permission will not make the file executable or otherwise. But what msys2 gives as the permission seems to affect completion. It is irritating to have some files.sh autocompleting on tab and some not.

like image 932
Phil Lord Avatar asked Jan 03 '23 03:01

Phil Lord


1 Answers

For scripts, ensure that they begin with a shebang. For shell scripts, try:

#!/bin/bash

This should cause MSYS2 to believe the file is executable, and allow tab completion.

like image 191
SpaceManiac Avatar answered May 16 '23 07:05

SpaceManiac