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 know it works only when
a> field 2 of file1 matches exactly with field 1 of file2 (no order reqd.)
b> exact number of lines are present in both files.
Edit - Would love to see smarter text/string manipulation logics
Last edited by Honest Abe; 06-24-2018 at 01:56 PM.
Again, you need to read the LQ Rules about posting homework questions, and the "Question Guidelines" about just asking people to write your scripts for you.
and those not putting in any effort don't usually get the best solutions.
fwiw, i'd use bash string manipulation for this.
assuming the separator is always a colon ':', and it's always the first and the last word, something along these lines:
I have two files:
...
How can I create this output using command line (bash)?
Thanks for your support.
@freeroute,
Please be cognizant of the LQ Site FAQ and how to ask effective questions.
Your thread here, awk - cut usernames from mail addresses with gsub or regex is a very good example of a good question. You described the problem, illustrated what you had done, and then asked for some alternate means to accomplish your goal.
Meanwhile, in this thread, as well as some others, you seem to solely ask, "How do I do ...?" without describing any attempts you have made.
Please recognize that, like yourself, all other LQ members are volunteers and that the site is designed to aid your efforts, while you work alongside your fellow advice givers, to accomplish your goals.
Please read the LQ Rules and the "Question Guidelines" before posting such questions again. We don't mind helping, but you just keep asking for us to write your scripts/hand you things.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.