I am making a bash script to change the password to include part of the serial number, but I only need the last 5 digits.
Using this I can set serial as a variable to the full serial number.
serial="$(ioreg -l | grep IOPlatformSerialNumber | sed -e 's/.*"(.*)"/1/')"
Is there a way to ignore everything but the last 5 characters?

