Display Terminal message on login I want to display something like ### this is a test ### when a new Terminal window is open (and ideally, in a way that can be disabled easily). On Linux this was straightforward; you'd create a script in /etc/profile.d/ which would be responsible for echo-ing the message when a new Terminal session is opened.
I've been playing around with launchd to try to get this to work but to no avail. I've created an agent in /Library/LaunchAgents/org.test.greeting.plist with the following code (where the greeting.sh file is responsible for doing the echo) hoping to get some output when the user logs in.
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;
&lt;plist version=&quot;1.0&quot;&gt;
&lt;dict&gt;
    &lt;key&gt;Label&lt;/key&gt;
    &lt;string&gt;org.test.greeting&lt;/string&gt;
    
    &lt;key&gt;ProgramArguments&lt;/key&gt;
    &lt;array&gt;
        &lt;string&gt;/Users/test/greeting.sh&lt;/string&gt;
    &lt;/array&gt;
    &lt;key&gt;RunAtLoad&lt;/key&gt;&lt;true/&gt;
&lt;/dict&gt;
&lt;/plist&gt;

This hasn't worked, as the message is lost to the ether. However, I do know that the agent is running successfully. I know it is possible to redirect the output to a file using StandardErrorPath and StandardOutPath but those are not useful to me.
Does anyone know how to get this working with launchd, or maybe have another way of doing this?
I like the message of the day for this.  As tradition dictates...
me@Mac ~ % echo &quot;Welcome to the University of East Westia&quot; &gt; /tmp/motd
me@Mac ~ % sudo mv /tmp/motd /etc

Note: /etc/motd is only displayed in a login shell, which is typical of Terminal.app on macOS.  If you typically run non-login shells, you should handle display of /etc/motd in your shell dot files.