ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
According to this (I don't run OSX) all your options are supported except -printf; perhaps try putting the directory it should search in after "find"? ie:
find . -type f -name '*.dx'
As I said, OSX doesn't seem to support -printf, though it does support -fprintf. So you could either experiment with the -print0 option, or -fprintf to a file and then read it in for the next part of your loop.
I've come across another problem with this. Here's my code now (the extra lines of code (from above) haven't been changed):
find *.dx -print | sort -n -t _ | while read protein && read water; echo $protein $water; do dx ; done
It does everything that I want it to do...It's just not terminating properly. It takes the last 'water' file and keeps trying to run the dx function on them. It'll keep spitting out error messages until the process is killed. The program is outputting *out.dx files, but I wouldn't think that'd interfere.
The echo command shouldn't be causing the problem either, should it?
Anyone know how to properly end this?
Last edited by jdmResearch; 07-25-2011 at 02:44 PM.