Write Command - with script

This is all on a Unix computer where I login using Putty (for references sake).

I was wondering if it was possible to use the write command with an already predetermined message in mind.

I'm attempting to write to another user, but I'd like to do something like:

write user1 "Message"

So basically after this program is executed, it will write to user1's terminal with the corresponding message.

Maybe there is someway to pipe a message through to the write command?

Thanks,
-Chad

Like:

echo Message | write user1

(i.e. using a pipe, as you said)

1 Like

Exactly, thanks.