Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
it just kinda makes no sense at all, in many ways, I'm afraid. what do you expect it to do? the echo command is being tagged onto the end of the assignment execution, you're following the tail, that command will never finish... drop the idea of assigning the sed output to anything, i'm sure your output can easily be made to fall out the end, do you now just want a grep after it maybe?
What i want, is to take sed's output (an email address) and "post" that address to an external script that will -in turn- insert that email address to a database. Sorry for my poor bash skills, i just feel certain that it can be done somehow. No?
tail -f /var/log/mail.log | grep to= | sed -nr 's/.*to=<([^>]*)>.*/\1/p'
This also prints email addresses on the screen (quite natural, since you made it ..) and still leaves me wondering how would i go about with "posting" the result of grep to an external script. Again, sorry for my poor knowledge of bash scripting (i am getting better by the minute, hanging out with you people..).
well you'd probably just pipe it again onto yet another command. Note again though, as you're tail -f'ing this, the command will never complete, so you need to work out how to deal with that.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.