I am Trying to show the active Users password expiry on logon. I created a bash script and placed it in /etc/profiles.d/ which contains:
#!/bin/bash
me="$(whoami)"
echo "$me"
chage -l $me
also tried it with
chage -l tobi
But if start the script over console for testing or by startup, it gives me the output: tobi (my username on the VM) ' does not exist in /etc/passwd
But when i run the command
chage -l $(whoami)
on the console, it works and shows me the password expiry for my user.
Anyone have some suggestions ?
OS: Ubuntu 20.04.2 LTS
Greetings
Darkwolve3