Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's 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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I don't see any problem mentioned, other than in a vague "it doesn't work" kind of way.
Please post an actual example of the input text, and what the output should be like. It might also help to show or explain what your previous attempts actually do.
Edit: would something like this do?
Code:
sed -i '/SmtpGreetingMessage/ s| $v/$Z||' /etc/mail/sendmail.cf
Last edited by David the H.; 06-21-2012 at 10:51 AM.
Reason: as posted
Wow that worked great, why doesn't any of my books mention anything about using the "|" symbol to translate $ and / into simple text, I will be using this format alot more now that I know, again thanks.
Yes, the man page doesn't mention it, but the info page does. Any basic-level ascii character can be used as the delimiter. Most good, detailed tutorials should mention it too. I generally prefer using the "|" pipe myself, but any character that doesn't appear in the expression will do just as well.
Coincidentally, I also posted an expanded explanation in another thread yesterday:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.