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.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
perl, where did that come from? You asked for a sed solution
Maybe you just settled for perl. It's strange that the two examples given don't seem to work (you remember what went wrong?). I just tried both of them and here they do what they are supposed to do.
But, you have a working solution, thats all that matters in the end
@Gins: By now I don't need books/the net for this, but that's experience.
@jakev383: You do know that the " after sed and before infile are double qoutes, not 2 single quotes? The '' after the / and before the ; are 2 single quotes.
Where did perl come from? Once thing I've learned in Linux - it doesn't matter what you do or how you do it, as long as 2+2=4 in the end. If nothing else I think it's safe to say there's at least 3 ways of doing anything in Linux.
That being said, when I was doing a search-n-replace sed popped in my head. I couldn't get it to do what I wanted and after Gins bumped me with those double quotes, well, sed still didn't work but I thought "why not try perl?" since I was using it 5 lines prior in my little script anyway.
And yeah, I don't know why those don't work either. I ran them on a Cent4.4 machine which shouldn't matter but I've seen some weird things on Debian distros where /bin/sh wasn't linked to /bin/bash so scripts did funny things sometimes.