I'm trying to write a simple bash script in which the user inputs their username, then they are greeted, depending on the time of day by their surname. I currently have the following:echo Please enter your usernameread usernamename=$(grep $username /etc/passwd | cut -d ':' -f 5)h='date +%H'if [ $h -lt 12]; then  echo Good morning ${name::-3)etc. etc.I have managed to cut the 3 commas off the end of the name that are there, but I want to be able to cut the first name off.For example:The $name is Amber Martin,,,.I've cut down to Amber Martin.I need to cut down further to Martin.And this needs to work with any name.
How can I remove first name from surname when the length is unknown?
linux;shell;text processing;cut