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.
ah sorry, I did include the {} \; but still the same error. I'm not too familiar with the syntax difference between scripts written for sh or bash. Could anyone take a look at the original script that I need to run and see if there's a problem with that and how I'm running the find commands? I got the script from a forum for the software that its calling up so maybe there's differences between that script and how I'm running it on my computer?
I apologize for bothering everyone with this, just wish I could figure it out and run it without any more problems.
I get an ungodly amount of C source files, but assuming someshellprogram actually exists and this is just a dry run to see what will be done, you can see it's quite useful. Here's a very small random clipping from the output:
Actually looking at this gave me an additional idea. You might want to replace the dot for current working directory into the full directory name like this (might as well make the shell program one too)::
So I took your suggestions and tried them all. Please take a look at the things I ran below.
For Reference here is the script again. Perhaps there's some variable in the script that I need to change? Note: I tried running the codes with and without the italicized portion of the script but in both instances, it output errors.
Ran:
1. Ran Tree to make sure that the file I was looking for is present in the subfolders. It was.
2. Ran pwd to make sure I was still in the correct directory.
3. Ran ls to make sure the directory folder had all the correct files and scripts. It did.
4. Ran the find code provided with 'echo' - seemed okay
5. Ran the find code without absolute paths - error
6. Ran the find code with absolute paths - error
Please check if I have done everything correctly.
I have been racking my brain trying to figure this out but it's only frustrating me more. It would really be a HUGE help if I can get this to work!
first I'd stop being in Desktop when running this. second I personally would code paths in the script, but that last part is deff me,
Code:
TARDIS@ubuntu:~/DWI$ find . -name '*.ecclog' -exec ec_plot.sh {} \;
find: ‘ec_plot.sh’: No such file or directory
find: ‘ec_plot.sh’: No such file or directory
find: ‘ec_plot.sh’: No such file or directory
where is the script located when using the dot for path in find?
what directory are you in when in the terminal running the find using the dot?
Code:
TARDIS@ubuntu:~/DWI$ find /home/TARDIS/Desktop/DWI -name '*.ecclog' -exec /home/TARDIS/Desktop/DWI/ec_plot.sh {} \;
find: ‘/home/TARDIS/Desktop/DWI’: No such file or directory
TARDIS@ubuntu:~/DWI$
again using the directory Desktop, I'd shy away from that like a 11yr old boy at a school dance.
actully open a file manager and create a different directory like 'scripts'
the way it is looking at it using find.
Code:
find [path to files needing processing] -name '*.ecclog' -exec [path where script is located]/ec_plot.sh {} \;
that desktop folder might be what is throwing this off.
Yes, it looks like you're still not putting in the full path to your script. Plus try to copy and paste one of those echo'ed command to the command line and see if you still get the same error.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.