Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

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
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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