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.
Usually awk shows the number of the line where the error occurred. Please show us the complete error message along with the relevant parts of the code. My suspect is that the file movie.xyz is not actually an Extended XYZ file.
This means that 'det' is 0, 'r' is not assigned or it's 0 (see line 47), the same for 'lattice' (see line 43) and for 'lat' (see lines 36-38). I stay of my idea that the input file is not really an Extended XYZ.
You can easily verify by the following commands:
Code:
file movie.xyz
and if it is an ASCII text file:
Code:
head movie.xyz
You should see the line starting with Lattice with all the key/value pairs of an Extended XYZ.
This confirms that your file movie.xyz is an ASCII text file, as it should be. A general advice: if you're new to the linux command line, always (and I mean always) check the manual page of every command you're suggested to type. Don't trust commands blindly, since everyone could make a typo or a mistake of some kind. It's better you're sure about what you're doing.
But maybe you already did. This is ol' pedantic uncle colucix speaking!
Yes. It is an extended XYZ file. On the other hand it is the example from the developers site, isn't it? Just out of curiosity I tried the code you've posted on the example file and it works for me. Having GNU Awk 3.1.6, here.
At this point I can't explain the error anymore. I have some experience with awk, but I cannot see any mistake in the code.
My suggestion would be to work from the "det" backwards. According to the code and the supplied example your "det" value should equal : (5.44)^3
So throw in a print statement just after "det" is set and see what value is stored?
If this is equal to zero then you need to check further up the chain.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.