I need to create a bash script that will work on a mac. It needs to download a ZIP file of a site and unzip it to a specific location.
curl -O
)unzip filename.zip path/to/save
)I need to make it so people can double-click the text file on their desktop and it will automatically run in terminal.
How do I make it so that the user can double click the icon on the desktop and it will run? What extension does the file need?
OSX uses the same GNU sh/bash as Linux
#!/bin/sh
mkdir /tmp/some_tmp_dir && \
cd /tmp/some_tmp_dir && \
curl -sS http://foo.bar/filename.zip > file.zip && \
unzip file.zip && \
rm file.zip
the first line #!/bin/sh
is so called "shebang" line and is mandatory