[SOLVED] I need an awk statement that will look for the home directory and comment it out.
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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 need an awk statement that will look for the home directory and comment it out.
I need an awk statement that will look for the home directory and comment it out in fstab. The reason is we have multiple ways of defining the device path for differt servers so sed will not work all the time. Does anybody know a simple way to do this with awk?
What are those multiple ways? It's hard to say anything without knowing what you mean.
The problem is that it could be mounted by path, uuid or label so a simple sed option will not work for all instances. If we can use awk to search the second feild it would work to keep the script working with mount styles.
The problem is that it could be mounted by path, uuid or label so a simple sed option will not work for all instances. If we can use awk to search the second feild it would work to keep the script working with mount styles.
Ok, but how can you identify the second column of the right row if the naming conventions vary?
You know, instead of just giving vague descriptions and making people guess at your exact requirements, you could post an actual example of what you have, along with any conditions or variations that could be encountered, and save everyone some time.
And as demonstrated you shouldn't assume the use of any specific solution (at least not without a clear reason to do so). Focus on what you want to accomplish, not how you think it should be done.
@David - couldn't agree with you more, in fact I think it should be a provision of joining the site that you need to have read the whole thing and agreed to having done so prior to
account activation.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.