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.
Congratulations; you've done someones homework for them, and they have learned absolutely nothing from the exercise. Read the LQ Rules about homework questions, and if you're going to post something like this, don't then follow it up to advertise your 'linux learning' blog, which is also against the LQ Rules about advertising.
Quite correct and thank you TB0ne, as well as sundialsvcs for noting this, as well as noting that techchamp had advertised in one of their posts.
techchamp has been contacted about this infraction of LQ rules.
Also to note is that the OP may not understand the solution, or may find that the solution is not correct or ideal for what they want or need and then have follow-up questions. Per TB0ne's and sundialsvcs' points, the OP hasn't learned, while it may or may not help them to pass one technical question, they may not understand the answer at all. Therefore techchamp, your actions are nearly pointless.
I am posting the direct answer as this is for an assignment and not an enterprise activity.
That "answer" is also pretty poorly done. There are a lot of mistakes and faux pas in it, despite being all on one line. If it produces the correct output, it might get minimal points, but only based on the output not how the output was generated.
Last edited by Turbocapitalist; 02-17-2017 at 09:00 AM.
Although you have a one-line answer, is it the best answer?
Its got no documentation and its quite likely going to be hard hard to amend it for a similar problem...
Anyway the OP was supposed to be using 'cut' so I think he will get no marks for using 'awk' etc.
Although you have a one-line answer, is it the best answer?
It's not even a good answer let alone the best.
I don't want to break any rules, so I'll simply hint that you can do it all with a single 'join' command(*) and suggest you go read the manpage. Pay particular attention to the -t and -o options.
(*) Well, ok, if the input is not pre-sorted you'll probably also want 'sort'.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.