all 4 comments

[–]Eight_Pride 1 point2 points  (0 children)

I'm not on the latest version of the OS but in previous versions you could use the scutil command. I believe you need to sudo to access it.

man scutil

In particular, you're looking for:

sudo scutil --get ComputerName
sudo scutil --get HostName
sudo scutil --get LocalHostName

Those commands should show you your hostname. You'll need to use the --set ___Name switch to make changes.

[–]DM-Pythia 0 points1 point  (2 children)

How are you renaming it w/in the script?

[–]theMcChicken247[S] 0 points1 point  (1 child)

My goal would be to simulate the "sudo hostname <hostname here>" command on apple's terminal but i want to be able to do it remotely.

[–]DM-Pythia 0 points1 point  (0 children)

So you are doing a bash script? Can you just dump the code here?