echo "your_...@domain.com" | sed -e 's/your_email@//' # Works
# echo "your_...@domain.com" | sed -e 's/*@//' # Nope
# echo "your_...@domain.com" | sed -e 's/*@#//' # Nope displays all
# echo "your_...@domain.com" | sed -n 's/*@#//' # Nope displays none
exit
Question: How do I tell 'sed' that everything to the left of the
asterisk, including the asterisk, are to be replaced with
nothing?
... or ...
how can an asterisk be interpreted as a true wildcard and
not the actual character itself within sed?
I know I have one of Stocklers awkaholic scripts around here somewhere,
but I wouldn't understand it anyway. I miss being able to call him on
these type of simple questions.
Anyway... As always... TIA!
- Jeff H
Bobby would have cringed, since anytime sed was more efficient then awk,
his mouth would twitch. He knew awk backwards and forward, but had an
unjustified hatred of sed.
Your sed man page would quickly disclose that the asterisk is no
kind of wildcard in sed (nor in awk, for that matter). In regular
expressions, the asterisk means "any number of". The `.' stands for any
character. So `.*' in a regexp mean 0, 1 or many of anything. Thus what
you want is:
echo your_...@domain.com | sed 's/.*@//'
--
JP
JP
I remember Bob Stockler from years ago. What happened to him?
Mark
Thank you JP.
- That did the trick and thanks for the
explaination as to what made it work.
- Jeff H
He passed away in January.
--
JP
JP
I really regret hearing that. I subscribed to The Guru magazine which
John Esak published, and still have every copy. Bob Stockler had a
regular column about awk and I was always in awe of the depth of his
knowledge, as were many others I'm sure.
I know you had articles there on a regular basis as well, as did
several other contributors. In case nobody ever said "Thank You",
allow me to say it now. I appreciate it still, and continue to dig
out the copies I have on occasion and refer to them.
Mark
Thank you, Mark.
I really miss Bob a lot. We used to be on the phone with each other every
ten days or so.
--
JP