I've been trying to get the hang of cron jobs and shell scripts, but I'm facing an issue where nothing gets printed to the terminal. Here's a quick rundown of what I'm working with:
For my shell script located at /home/user/sayhello.sh, I've got the following code:
```bash
#!/bin/bash
wall "This message prints every minute."
```
In my crontab, I've set it up like this:
```
* * * * * DISPLAY=:0 xterm -e /home/user/sayhello.sh
```
It seems like the cron job is executing every minute since I checked the cron log, but I'm not seeing any output on the terminal. Any advice?
3 Answers
Before you go further, have you tested the `wall` command separately to see if it works on its own? The way I use it is:
```
echo "This message prints every minute." | wall
```
Try that in your terminal first. Additionally, I would suggest removing the `DISPLAY` and `xterm` references in your crontab. Cron jobs don’t usually have access to your graphical environment, which could be causing the issue. Just call the script directly in the crontab.
Have you tried running the script directly using `'/home/user/sayhello.sh'`? It sounds like there might be an issue with the shebang line. You might need to change it to `#!/bin/bash` instead of `!#/bin/bash`, which is why you could be getting a ‘No such file or directory’ error. Also, make sure you have execute permissions on the script through `chmod +x /home/user/sayhello.sh`. Let me know if that clears things up!
So I tried just running the script like this in crontab:
```
* * * * * /home/user/sayhello.sh
```
but I didn't see any output either. It’s probably still a permission issue or the way you're invoking `wall`. Make sure your script runs fine outside the cron first!

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically