Setting hostname via scutil When following various guides on using scutil the following would seem to be correct for setting the hostname:

$sudo scutil –-set HostName doriath
&gt;


But as you can see instead of setting the hostname a prompt &gt; is shown: and the hostname is not set.  What is wrong here?  I am on El Capitan.
The prompt is the interactive mode of scutil which usually is invoked by the single command scutil without options. To quit the interactive mode enter quit at the prompt.

In your case you are simply using the wrong dash: probably the en-dash (UTF-8: U+2013 - e2 80 93) and a normal dash and your whole command is interpreted as scutil only.

Instead of sudo scutil –-set HostName doriath use sudo scutil --set HostName doriath!