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.
the reason YOU should know how to run an awk file is because YOU know how to use man pages and documentation. you appear to make very little effort to find these things out for yourself. you should also be much more than capable of finding out how awk relates to nawk and gawk. how about you telling us what the differences are by your own research?
Last edited by acid_kewpie; 12-28-2007 at 05:48 AM.
The problem is there are so many programming languages and other stuff in the domain of computer science.
That is not a problem. The problem lies with you and the decisions you make.
Quote:
Who on earth can learn all those languages and other stuff?
Nobody asked you to learn all. If you want to do that, by all means. If you can't then, pick one ( whatever your criteria for choosing is ) and start learning.
Quote:
Now I have learnt there are other flavours of awk. They are gawk and nawk.
And many others. Check AWK's wiki, if you know what that is.
Quote:
I believe you are all working with Sed and Awk from time to time. If it is the case, you are somewhat familiar with all the nuances.
Not all. Its all a matter of choosing your tools to work with for different situations.
Some points for the OP.
(1) You are running the awk program.
(2) Giving the extension .c means nothing to linux. Its just a holdover from old times.
(3) The program script could have been called average_awk.script or anything.anythingelse
(4) Awk accepts program scripts and files (data files) in the command line.
So
awk -f awk_script_name (could be average.awk, anthing.anythingelse) then data files
C is a totally diferent language.
The C file contains C language english like instructions. By a separate compile process (usually cc), which we create an executable file (zeros and ones) having the same logic as your original program. (The default is a.out and can be renamed to average_awk.exe or average-awk.executable). This is given execute rights and is actually executed.
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662
Original Poster
Rep:
I thank acid_kewpie , ghostdog and AnanthaP for the replies.
You are all clever at awk, sed, shell scripting and other prgramming languages.
It is my stupidity that I don't read the related literature. I eat humble pie.
I recognize acid_kewpie for a several years. You are clever at UNIX. I think I told you that I hate to read the man pages. For me it is written in a boring manner. You are British. So you know better English than me.
There are other websites, for example the materials you have mentioned here, are written in attractive language. I read a part of them. I will read more when time permits.
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662
Original Poster
Rep:
acid_kewpie
Thanks for taking time again to reply me.
I did not say reading English is boring. I love to read English. I have bought a lot of books on computer subjects.
When I studied Cisco neworking course, all the books needed for the course were in English. I have big collection of Cisco Systems. I have spent thousands of money to buy them. They are written in beautiful and simple English.
In my opinion, so-called man pages were written in a way that people get fed up of them.
For me, the websites you are all have mentioned were written in beautiful and simple English.
In my case, it isn't about your english. It is about your basic assumption (.c extension and all of it) and my understanding of what you need to do.
I think that you should talk to somebody who introduced you to all this and review your entire approach (technically speaking) to using awk, c etc from first principles.
Make that not his last three years of using Linux... he refuses to
read man-pages consistently, and doesn't seem too good with using
google for information retrieval, either.
Cheers,
Tink
Last edited by Tinkster; 12-29-2007 at 02:58 PM.
Reason: too, not to
Depends on how we define "our job". I always hoped it was to
empower people to help themselves - in which case we're failing
because of the resilience of the subject to learning. :}
If "our job" is a quick fix every time he runs into a problem
and refuses to read or research ... yes, you're done! ;}
Depends on how we define "our job". I always hoped it was to
empower people to help themselves - in which case we're failing
because of the resilience of the subject to learning. :}
If "our job" is a quick fix every time he runs into a problem
and refuses to read or research ... yes, you're done! ;}
Cheers,
Tink
you guys put in too much dedication. :-)
I suggest we leave him to be, and enjoy a good weekend instead.
To clarify, the original version of awk was a bit limited to say the lest and was replaced by nawk (new awk) somewhere between 1985 and 1989. Solaris ships with both awk and nawk. Most other distributions seem to ship with either nawk renamed as awk or gawk, sometimes also referred to as awk (I believe). I'm pretty sure that what you are after is NOT the original version of awk which doesn't handle floating point arithmetic and is missing a lot of later functionality. In an out of the box Solaris solution, nawk should be your choice. Gawk (Gnu awk) is preferable, but as others have said portability is a real consideration. No point in developing under Gawk and then expecting your code to work under nawk on a Solaris box.
You just won't be able to learn all the languages available the way you might want to. Decide that shaped and sized pool you wish to occupy and dig it to suit. Specialise in that gives you most advantage in terms of work and enjoyment and gain a sufficiency of familiarity with some of the others so that you know when it's time to return and improve your skills to give you more advantages. One thing is sure, there is no reason for you to be out wasting your time on the streets, there is more than enough in the way of languages etc to keep you busy for a few years yet All good fun.
I Hope you had a good Christmas and are all set for a Happy New Year - and to the readers and valued forum contributers.
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662
Original Poster
Rep:
Thanks everybody for the comments.
PAix, I am running open SuSE. I think it is either 10.0 or 10.1. I know there are new releases. I didn't give a thought of upgrading yet. Because it works fine. Of course I have working Mandriva and Fedora Core. Sometimes I look at them.
When the computer starts, I can select openSuSE, Mandriva or Fedora Core. GRUB does the job.
There is a small problem of switching to the other distros. The cable modem refuse to recognize when I come back to open SuSE.
I must disconnect the power of the modem and wait for a few minutes and reboot the computer. This is time consuming. Though I like Mandriva and Fedora Core, I don't want to look at them.
I talked to my ISP. You know they support only Windows problems. They no nothing about open source.
I have 24MB per second data transfer. It is the highest speed in this area. In some parts of the country people get 100MB per second too.
How do I find out whether I have awk,gawk,nawk, etc. ?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.