A
A
Andrey2019-02-22 20:54:35
bash
Andrey, 2019-02-22 20:54:35

How to separate words with the symbol ";"?

echo ${string[@]} | grep -E -o -z "\b[A-Za-z0-9._%+-][email protected][A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b"

This line searches the text for email addresses and displays them.
Please tell me how to display the character ";" after each mail output (except the last one is a prerequisite)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Q
q2zoff, 2019-02-22
@officialandrey

echo ${string[@]} | grep -E -o -z "\b[A-Za-z0-9._%+-][email protected][A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" | tr "\0" \; | sed -r 's/(.*)./\1\n/'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question