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 need to make a list of the number of employees working in each department. With the name of each department once and the the number of employees. The file contains the following:
04,Hendrix,James,Engineering,9
889,Wallace,Mia,Accounting,8
096,Uffhark,Joan,Administration,9
120,Carrington,Blake,Accounting,8
053,Draper,Don,Marketing,3
413,Zappa,Francesco,Engineering,9 285,Gunvalson,Victoria,Engineering,9 744,Watts,Charles,Administration,8
409,Wilson,Brian,Engineering,9
346,McCormick,Kenneth,Marketing,2
070,Berlin,Rachel,Marketing,2
555,Zombie,Robert,Administration,7
217,Burns,Fahr,Accounting,8
154,Tennille,Antoinette,Engineering,9 843,Trakand,Elayne,Administration,8 654,Grumby,Jonas,Administration,7
026,Corleone,Michael,Marketing,3
599,March,Christopher,Engineering,9
808,Mann,Yoda,Engineering,9
strut does not work in bash, hum.. what class are you taking? what programming lang is it suppose to be in. else you could just go old school, and use a piece of paper and pencil to write out a list.
yes I tried it and I got this -bash: sorn: command not found
-bash: file1: No such file or directory
So you got messages and you chose to ignore them ?. And you want use to tell you why ?. Not going to happen.
Looks like you found that command string somewhere and used it without understanding what it is. Linux comes with a help system for commands called "man" - but only for commands actually installed. So "man sort" (no quotes) will work, but "man sorn" won't for the same reason as in you messages. Use "q" (no quotes) to exit the manpage.
Linux is case sensitive as well as expecting you to type names correctly.
All this should be provided in a beginner linux course.
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Rep:
Just a footnote: in my experience, instructors assign homework problems NOT because they don't know the answer, but because the task cannot be performed by students without them actually learning something. By approaching the problem with sound reasoning, and developing a solution based on sound research, the student not only learns how to solve the assigned task, but many other similar problems as well.
It would help us to know what you are starting with and what the result should be. So, could you type out the desired out file so at least 'you' know what you want it to look like? I can tell you that you probably want to look into writing a script using awk and/or sed. I doubt whether you'd be expected to use PERL in your intro class.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.