3

For example: A cron script runs in background checking for updates. The user is logged into a virtual console (tty).

Only wall has a nonbanner option.

Wall still adds unnecessary newlines at the beginning and the the end. Also pressing enter to return to the prompt is awkward.

Are there any alternatives for displaying notifications in a tty console?

1 Answer 1

4

The only other way I can think of is to write to their tty directly. Use the w or who command to find out which tty the user is on, e.g.

w joeuser
 23:10:41 up  1:46,  3 users,  load average: 0.18, 0.16, 0.24
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
joeuser  tty7     :0               21:24    1:46m  3:29   0.82s gnome-session -
joeuser  pts/0    :0               23:03    0.00s  0.18s  0.00s w joeuser

..and directly write a message to their tty, e.g.

echo "Hello World" | sudo tee /dev/tty7

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .