I need a bash script that prints the first letter of a name. Example: Ruben Van Den Bosshe becomes RVDB or Ken Van de Wilde becomes KVdW
I want to use the sed command.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There’s probably a neater way of doing this, but the following seems to work:
To break down that regular expression a bit, it matches the following in turn:
\(\w\)\w*\( \|$\)That sequence is replaced with whatever was captured in the first group:
\1