How to make a .command file that I can share without giving permissions on each computer

applescriptautomatorterminal

I have a terminal command that I would like to run.

    telnet 169.254.216.127 54326

Ideally I would like to convert this into a .command file and be able to share it with many other mac users without them having to give permissions using sudo…

Is this possible? Can I create an extremely simple app that keeps the terminal window open after it has run?

Any help would be much appreciated.

Best Answer

The execute permission does also transfer to other computers. If the permissions of the file are lost when you transfer the file, you might create a zip or tar archive for the .command file:

$ echo telnet 169.254.216.127 54326 > test.command
$ chmod +x test.command
$ tar -cf test.tar test.command
$ 

You might also save a script like this as an application in AppleScript Editor:

tell application "Terminal"
    do script "telnet 169.254.216.127 54326"
    activate
end tell