I'm using crontab to send messages to all users.
I wrote
*/1 * * * * wall $(bash some_shell_script.sh)
But the problem is I always have to press Ctrl+D to end the message.
How can I solve this??
I'm using crontab to send messages to all users.
I wrote
*/1 * * * * wall $(bash some_shell_script.sh)
But the problem is I always have to press Ctrl+D to end the message.
How can I solve this??
You can use GNU screen to isolate the process in the background without exiting.
screen -R wallwall $(bash some_shell_script.sh)The wall command executes within the context of cron. It does its thing and exits.
On the receiving display devices (terminals) you will get the notification from wall. This notification cares nothing about what you are doing on the terminal, so if you are quietly sitting at a command line prompt when the notification message is sent, the prompt will not be rewritten. You have found that you need to hit enter to get the prompt re-sent, but in practical terms this is unnecessary: you could simply enter your command normally.
Scenario timeline
wall notification is sent to your terminalls (and hit Enter)At step 3 you do not have a visible prompt but the shell is still patiently waiting for your command.
Alternatively, perhaps you're actually talking about how you exit from the crontab command. In this instance the Ctrl/D is used to signal the end of input.
Scenario
crontab*/1 * * * * bash some_shell_script.sh | wallcrontab commandNote that the Ctrl/D in step 3 is nothing to do with wall. Also, this crontab entry will repeat your wall command every minute. Is that really what you want?