Question

I am working under Windows 10 and am putting together a few data-files and a simple bash-script that I want to share with Mac-Users. (I am just learning MacOS, so may have drawn wrong conclusions somewhere...)

When I tried to use that stuff on a Mac, the script would not execute after unzipping and I needed to set its attributes to allow execution. Is it possible to do that already under windows so that the file unzips with desired attributes set?

Was it helpful?

Solution

I haven't used Windows in to many years; however, I understand there is a new Windows 10 feature called Windows Subsystem for Linux. Have a look at Everything You Can Do With Windows 10’s New Bash Shell and How to Install and Use the Linux Bash Shell on Windows 10. Maybe using this feature will enable one to create and zip a bash executable and retain its attributes once unzipped on a Mac. I haven't tested it, so this is more informational then a working answer.

There are quite a few steps in the two linked articles and so as not to make this a so called link only answer, since I'm not quoting any of the steps, let me tell you something you can do from Windows that will work for sure...

Install Linux in a Virtual Machine and do your scripting, make it executable, and zip it up in the Linux VM. A zipped bash executable from a Linux Virtual Machine will be executable on macOS when unzipped.

Licensed under: CC-BY-SA with attribution
Not affiliated with apple.stackexchange
scroll top