Friday, 25 September 2026

So ya gotta shiny new mac and want to run linux scripts?

 So, you've sold your soul to the devil and bought a shiny new or second hand ( in my case ) mac book pro ( with the shiny new apple silicon you know the one that isnt apple silicon but something they licenced from arm and added a few tweaks and whistles too but called it apple silicon cos apple is soooooooooooooo innovative) and now you have a folder full of linux bash scripts you want to run but now they wont work cos , yay non standard everything and well , apple. 

so first things apple is based on unix it inherits a lot from bsd ( you see sooooooooo innovative) , linux is unix like in philosophy but isnt based on bsd its different so a lot of the commands you know and love on linux wont exist or exist in different versions and operate slightly differently so to get those commands working on mac os as they do in linux go here , read and implement what they say here : Hint - you need to install homebrew first 

https://www.developnsolve.com/linux/running-linux-terminal-on-macos 

But then go here cos this is what makes it all work from the terminal 

https://www.developnsolve.com/linux/running-linux-terminal-on-macos 

But then, cos mac os you need to do this in your terminal to have access to that gnu goodness instead of whatever the eff it is mac os ships with,  first on a temporary basis do "source ~/.linuxify" 

to make it permanent do  

 "echo 'source ~/.linuxify' >> ~/.bash_profile" ( ignoring the quotes obviously )

But the fun doesn't stop there

if you want to , heaven forbid convert from jpg to gif in the terminal say mogrify -format gif *.jpg , or one image say mogrify -format gif example.jpg you get not one but two files created , ie example.gif and ._example.gif , soooo if you have a script that does this somewhere "find . -maxdepth 1 -name '*.gif' | head -n 2 | xargs -d $'\n' mv -t $h/frames/" - that script is going to fail , so you have to add in exceptions like this " ! -name '._*' " to that line so it becomes "find . -maxdepth 1 -name '*.gif' ! -name '._*  | head -n 2 | xargs -d $'\n' mv -t $h/frames/"

so things like that will have repercussions through out a script - if there is a quick answer I havent found it yet but im looking . This will be updated later on when or if i find a simple workable solution - mac os apparently has something called dot clean for such a circumstance but ill need to investigate and then see if it can be implemented while a script is running .  

 


So ya gotta shiny new mac and want to run linux scripts?

 So, you've sold your soul to the devil and bought a shiny new or second hand ( in my case ) mac book pro ( with the shiny new apple sil...