Catching first letter.
Hi,
I'm writing a script and am stuck with something which I think is pretty simple but can't get around it.
echo "Please enter the first name of the new user in LOWERCASE."
read firstname
echo "Please enter the last name of the new user in LOWERCASE."
read lastname
What I want to do next without the user having to type in any thing else is get the first initial of the $lastname and have it set to $initial or something.
I've tried using echo $lastname | read -n 1 initial but it doesn't seem to work.
Has anyone got a simple alternative for me?
Thanks alot.
Regs
Craig
|