LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   How to broadcast a message to all user's. (https://www.linuxquestions.org/questions/slackware-14/how-to-broadcast-a-message-to-all-users-99634/)

GazL 01-13-2011 05:24 AM

The wall command in Slackware (at least in Slackware Current) is from util-linux-ng 2.18 and doesn't appear to support the -n option. Perhaps the gentoo one is from a different origin or version.


There's plenty of ways of doing this though,

msmi10 has since modified his code example above to something that should work (though it'd be better with quotes) so I'm not sure why there was a need to resurrect this thread once again. Resurrecting long dead threads wastes everyone's time and is annoying when you don't spot it is a zombie. Reading back I was clearly overly harsh with him, I guess I wasn't in a very tolerant mood that day (Everyone has bad days).

In the hopes of finally laying this one to rest, I'll just finish with another couple of possibilities.
In recent bash versions, you can use the syntax
Code:

wall <<< "Never argue with an idiot. They drag you down to their level and then beat you with experience."
More portably, you can use a here-document, which also has the advantage of allowing you to do a few other fancy things like pre-formatting, or include variables
and command substitutions
Code:

wall <<_EOF
Some text here
    and here's some indented
    and today's date is $(date)
and so on.
_EOF

or, as has already been mentioned you can just take the input from the output of another command in the more usual pipe syntax, as per the now corrected example msmi10 posted.

dalek 01-13-2011 05:40 AM

Quote:

Originally Posted by GazL (Post 4222758)
The wall command in Slackware (at least in Slackware Current) is from util-linux-ng 2.18 and doesn't appear to support the -n option. Perhaps the gentoo one is from a different origin or version.

Here, it works even without the -n option. On Gentoo, that command is part of sysvinit-2.88-r1. So, there is no telling what sort of differences there is between Gentoo and Slackware.

:D :D

GazL 01-13-2011 05:59 AM

Quote:

Originally Posted by dalek (Post 4222770)
Here, it works even without the -n option. On Gentoo, that command is part of sysvinit-2.88-r1. So, there is no telling what sort of differences there is between Gentoo and Slackware.

:D :D

:) There are one or two commands that seem to be differ between distros: 'rename' is another one that I find differs.
Having said that, basic 'wall' usage is that simple I'm surprised anyone could manage to have a problem using it.

Anyway, old thread and really not worth labouring over. Thanks for posting dalek.

dalek 01-13-2011 06:02 AM

Quote:

Originally Posted by GazL (Post 4222785)
:) There are one or two commands that seem to be differ between distros: 'rename' is another one that I find differs.
Having said that, basic 'wall' usage is that simple I'm surprised anyone could manage to have a problem using it.

Anyway, old thread and really not worth labouring over. Thanks for posting dalek.

Yea but it did remind me to update my sig with the new and improved rig.

:D :D

unclejed613 01-13-2011 08:23 AM

this works for me in slack 13 (i think i asked this question in another thread...)

Code:

wall {enter}
type whatever message you want here
it can even be several lines
because wall will send all it when you hit
{control} d


GazL 01-13-2011 08:37 AM

On reflection, I think all the confusion over this is a BSD v SYSV issue.

Slackware appears to use the bsd syntax
wall [file]

Other distros (Gentoo being one from what dalek said above) use a SYSV syntax
wall [message text]

However, both versions will accept input on stdin.

unclejed613 01-13-2011 05:39 PM

ah-ha.... i did a "man wall" and the manpage says:
Code:

WALL(1)                  BSD General Commands Manual                  WALL(1)

NAME
    wall -- write a message to users

SYNOPSIS
    wall [file]

DESCRIPTION
    Wall displays the contents of file or, by default, its standard input, on
    the terminals of all currently logged in users.

    Only the super-user can write on the terminals of users who have chosen
    to deny messages or are using a program which automatically denies mes-
    sages.

    Reading from a file is refused when the invoker is not superuser and the
    program is suid or sgid.

SEE ALSO
    mesg(1), talk(1), write(1), shutdown(8)

HISTORY
    A wall command appeared in Version 7 AT&T UNIX.

AVAILABILITY
    The wall command is part of the util-linux-ng package and is available
    from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.

Linux 0.99                      March 8, 1993                      Linux 0.99
~

so yes, Slack uses the BSD wall, but the manpage really doesn't go into the details of the stdin input usage.

gee... from looking at the manpage for talk, it looks like talk could be used as a basic IM on a local network... i'll have to play with it a bit

dalek 01-13-2011 05:49 PM

Mine says it was written by Miquel van Smoorenburg and at the top says "Linux User's Manual". It appears that Gentoo uses something entirely different. Sort of wonder why they didn't name it something different too. Maybe gwall or something if it is only used on Gentoo.

:D :D

Nille_kungen 01-13-2011 07:38 PM

Reading this thread i saw that the command first posted used ! so using " " won't work.
So use ' ' instead.
Code:

echo 'Please log off now!!!' | wall
or
Code:

wall <<< 'Please log off now!!!'
Or to play some more.
Code:

wall <<< 'Who want'\''s lunch?'
Code:

wall <<< "Who want"\'"s lunch?"
But i almost feel ashamed answering in this old thread.

Lunar 07-09-2012 01:18 AM

Quote:

Originally Posted by Nille_kungen (Post 4223643)
Reading this thread i saw that the command first posted used ! so using " " won't work.
So use ' ' instead.
Code:

echo 'Please log off now!!!' | wall
But i almost feel ashamed answering in this old thread.

Thank You.. Finally code that actually works!

Landis.

Flashwalker 02-11-2014 02:44 AM

wall absolutly doesn't broadcast anything on Ubuntu 12.04, when using by root or by user.
Works only via ssh and doesn't support cyrillic.

ponce 02-11-2014 02:52 AM

maybe that's why this topic is in the Slackware forum, not the Ubuntu one.

if you have questions/reports about the usage of wall on Ubuntu, open a topic on the dedicated forum, don't revive an old thread on random ones (if you had read all this one you could have seen this -the awkward reviving- already happened in this same thread).

brianL 02-11-2014 04:11 AM

Drive a stake through this thread's heart.

Flashwalker 02-12-2014 11:28 PM

1 Attachment(s)
Quote:

Originally Posted by ponce (Post 5115387)
have seen this -the awkward reviving-

Attachment 14740

randomjedi 05-12-2015 06:06 PM

I'm glad this thread still exists.
 
I joined just to say I use your site all the time and finding threads even as old as 2003 and having users still replying to them in 2015 and beyond shouldn't upset people because they're 'old'. This information is still useful, even today. Isn't that the point of a forum like this? :p

ANYWAY, I found the information on wall <<< "text here" useful, so thanks! :D


All times are GMT -5. The time now is 05:18 AM.