-3

Compare

dd if=/dev/urandom bs=512 count=4

to

write lsr < <(dd if=/dev/urandom bs=512 count=4)

How do I achieve the intended behaviour? Current output:

Message from qwe@hhgw11 on pts/386 at 17:37 ...
^[\305^\I\216\372\265\204\257\244+\277^X\334\303\273\261\200\253\323g\
...S\322EOF
8
  • 3
    Why would you want to do this??? – derobert Jun 8 '17 at 17:12
  • 2
    This is the intended behaviour. By the author(s) of the write utility. – roaima Jun 8 '17 at 17:15
  • 2
    @user234461 Sockets would be a normal way. You could also use a FIFO (though that's inside the filesystem, but it could be somewhere visible to both of you, e.g., /tmp). You could also, if you insist on using wall for this, Base64 or uuencode the data first. But really, if you want to share source code... use a version control system like git. – derobert Jun 8 '17 at 17:32
  • 3
    @user234461: Why does your source code contain non-printable characters?  Why not just copy your file to /tmp and let the other user copy it from there? And don't you have email? – G-Man Says 'Reinstate Monica' Jun 8 '17 at 17:41
  • 3
    You should also be able to mail files to each other if you give mail the -a option to create an attachment. It might use some type of encoding, but your mail user agents will take care if that transparently. – Mark Plotnick Jun 8 '17 at 18:15
5

Being able to send control characters (other than a few safe ones like newline and tab) to another user's terminal would be a security bug, so there shouldn't be a way.

2
  • Well in that case, wall has a security bug, because newlines and tabs are control characters. – user234461 Aug 15 '19 at 0:18
  • 1
    @user234461 True, those are control characters. Edited to fix. – derobert Aug 15 '19 at 19:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.