Web服务器可以写入登录用户的屏幕吗？(Can a web server write to a logged-in user's screen?)
I have a very simple bash script saved in my www folder in Apache directory, which prints "website hit" whenever the php script is called.
The problem is i want that print to print on the local screen i got plugged in with the HDMI. currently is not printing anywhere, i think its because its printing it somewhere else.
I did try everything now and i cant figure out how to get the bash to echo to the user logged in locally.
Is there anyway i can print to a specific logged in user which is local?
Thanks in advanced
echo "some text" >/dev/tty1。 （显然，您需要确保运行Web服务器的用户具有对设备的写入权限）。
To write to a user, use the
talkcommand. It has a man page:
man talkis likely to be helpful.
If you want to write to TTY1 regardless of which user is logged in,
echo "some text" >/dev/tty1. (Obviously, you'll need to ensure that the user running the web server has write permissions to the device).