Skip to content

Instantly share code, notes, and snippets.

@thesubtlety
Created August 16, 2018 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thesubtlety/8ebcf37cf74dde0c832256cae7e1e186 to your computer and use it in GitHub Desktop.
Save thesubtlety/8ebcf37cf74dde0c832256cae7e1e186 to your computer and use it in GitHub Desktop.
MacScriptify bash oneliner
# save oneliner as macscript.txt
$f=macscript.txt; echo "Dim s As String\n"; for each in $(base64 -w0 <<< $(cat f) | fold -w 90); do echo "s = s + \"$each\""; done | sed '0,/\ s\ \+/{s/\ \+//}'; echo 'MacScript "do shell script "" echo " & s & " | base64 -D | bash "" "'; echo 'End Sub'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment