I dont have to do this often and it always trips me. Should be trivial, but I cant remember what the issue is.
I update the example to something simpler:
Please consider this first
-
-
-
-
- DISPLAY=:0 /bin/su - $usernamenotroot -c $(xterm -hold -e whoami)
#Where $usernamenotroot is an arbitrary user on the system except root you want to display the message to, in an xterm from this cron entry running in root.
Whoami must obviously display the user’s name in the terminal. That is unfortunately not what happens. Obviously I will alter the Display number for every user, but lets stick to 0 for the example.
- DISPLAY=:0 /bin/su - $usernamenotroot -c $(xterm -hold -e whoami)
-
-
-
Anyone knows how to solve this, as I think I will solve the rest of my problems if I get a solution to this.