Jump to content

Create executable terminal file?


Thmz
 Share

3 posts in this topic

Recommended Posts

Hi,

 

For my network card I need to execute this line in the terminal: sudo ifconfig en0 lladdr MY:MA:CA:DR:ES:S0

but is there a way to put that in a file that I can execute by clicking on it?

 

:)

Link to comment
Share on other sites

  • 4 months later...

add that line in a PLAIN text file (google if you need to, or use vi ) and add this as your first line:

 

#!/bin/bash

 

then save the file as <whatever>.sh

 

Finally, make it executable by doing:

 

chmod +x <nameof file>.sh

Link to comment
Share on other sites

  • 3 weeks later...

you can also write a simple applescript like

on open
do shell script "sudo ifconfig en0 lladdr MY:MA:CA:DR:ES:S0"
end open

 

But I guess you'll have to enter your password as well. I guess you should be able to modify your accounts permissions so you don't have to. I'm rather new to OSX so I don't know for sure how the accounts and groups work here ;)

Link to comment
Share on other sites

 Share

×
×
  • Create New...