I have a fairly good amount of knowledge with Batch. I'm trying to port a batch script over to Mac/UNIX, but my batch file has a drag-and-drop thing to it. Through countless Google searches, I have came up with nothing. They all say that you can drag-and-drop into a Terminal Window - not good for no-input-required scripts.
Here is the code for Batch I have:
cd %USERPROFILE%
7za x %* -o%USERPROFILE%\Desktop\Temp
7za a %1 %USERPROFILE%\Desktop\Temp\*
cd %USERPROFILE%\Desktop
rmdir /q /s Temp\
Not particularly worried about 7za commands (because of Archive Utility),cd %USERPROFILE%
(because Terminal starts in the user's profile), rmdir
, cd
, and such, as they are only basic file commands. But I don't know the code to reference to the file dropped/opened with the .sh script.
So, if someone knows that code, please tell me. I know this is kind-of a simple thing, but you can't know every command, especially when dealing with unfamiliar programming languages.