Hi, > >I'm using write(1) on machines where people are logged in for days, weeks, > >months, running a tmux, as well as their write-sessions. > >It's annoying to not know the date when somebody talked to you. > > > >What do you think about the attached patch (write.1 modification would > >follow)? It just adds a flag '-t', which prepends the messages being sent > >with a date (i.e., you and your communication partner have to agree on > >using that flag to have it useful to yourself). > > When you propose a change to the way something works, it's > important to get agreement about the usefulness of the change > before (or at the same time as) you ask people to review the > actual code. At this stage of the process, man page changes, and > examples of output before and after the proposed change, would be > more useful then code diffs. > > In other words, a better question than "what do you think about > this patch to the code" would be "what do you think about this > description of the changed behaviour". Review of the actual code > is also useful, and that can happen at the same time, or later. ok, a manpage diff is attached. The communication then looks like: On pts/1: # tty /dev/pts/1 # ./write -t root pts/0 this is a message with a date prepended. another message On pts/0: Message from root@ on pts/1 at 17:05 ... May 18 17:05:26: this is a message with a date prepended. May 18 17:05:30: another message Without -t: On pts/1: # ./write root pts/0 this message doesn't have a date you don't know whether it has been sent three weeks or three mintes ago On pts/0: Message from root@ on pts/1 at 17:07 ... this message doesn't have a date you don't know whether it has been sent three weeks or three mintes ago Regards, Julian
Index: usr.bin/write/write.1 =================================================================== RCS file: /cvsroot/src/usr.bin/write/write.1,v retrieving revision 1.6 diff -u -r1.6 write.1 --- usr.bin/write/write.1 7 Aug 2003 11:17:48 -0000 1.6 +++ usr.bin/write/write.1 18 May 2012 13:04:04 -0000 @@ -40,6 +40,7 @@ .Nd send a message to another user .Sh SYNOPSIS .Nm +.Op Fl t .Ar user .Op Ar ttyname .Sh DESCRIPTION @@ -65,6 +66,12 @@ indicating that the conversation is over. .Pp +The +.Fl t +flag makes your write session prepend every message you send with the current +date and time, such that your communication partner knows the time when you sent +the message. +.Pp You can prevent people (other than the super-user) from writing to you with the .Xr mesg 1
Attachment:
signature.asc
Description: PGP signature