Linux "write" command to send messages

A colleague of mine has been sending me messages using write command to send me messages on our HPC login node. However, when I try to use the command, e.g. something that looks like write recipient pts/n I get this printed to the terminal:

for f in about author example group param version
do
    eval "$f() { :; }"
done
unset f
cite ()
{
    about creates one or more meta keywords for use in your functions;
    param one or more keywords;
    example '$ cite url username';
    example '$ url http://somewhere.com';
    example '$ username alice';
    group composure;
    if [ -z "$1" ]; then
        printf '%s\n' 'missing parameter(s)';
        reference cite;
        return;
    fi;
    typeset keyword;
    for keyword in $*;
    do
        eval "$keyword() { :; }";
    done
}

Anyone know how to use write properly to send messages/avoid this output? Am I missing something?

pts is actually a command that is installed on some systems… So you might not want to literally try use that as a message. The write I use has tty as an optional argument — so have you tried the command without?

$ write username
This is the message.
[CTRL-D]

…is all that is necessary on all the systems I’ve used over the years. If you want to sent a longer (editable, multi-line) message, then:

$ write username <<alldone
This
is
the
message.
alldone

With ‘alldone’ being any arbitrary terminating string you care to use.

I’m not sure what complexity your HPC setup adds to the process. Whether tty/pty is mandatory, for example.

I’ve tried using write without the tty argument. Likewise sending multiline messages with/without tty. I get the same thing printed to my terminal that I refer to in the original post.

I’ve also tried this on my Ubuntu workstation that has ssh enabled. It prints the exact same thing as the HPC

which write shows /usr/bin/write ?

Also, do you happen to have composure installed? If so, uninstall it and try it again.

Yes which write shows /usr/bin/write
We don’t have composure installed on our HPC. It’s not installed locally on my workstation either.

Some additional info, I just checked who -T and it looks like every user has a + by their name indicating they can all receive messages. And using echo Hello World >> /dev/pts/n where n is the pts assigned to me will print Hello World to my terminal. For other user terminals, there are permission issues.

Ok, I’m all out of ideas then. The output you are getting is pretty-much identical to:

I don’t know if composure’s author copy-pasted the code from somewhere else, or if you are running a package that copy-pasted from composure. Probably the former, if the symptom presents itself on a vanilla Ubuntu workstation. In that case it’s like looking for a needle in a haystack.

Sorry.

Hmmm, I see. Thanks for the help anyways. I’ll come back to this thread if I ever end up figuring it out.