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.
(Note that this guide isn't specific to gnu find, so some minor points may be slightly different, and some gnu features aren't mentioned, but it's a good general tutorial.)
Edit: One more friendly suggestion, this one about your post. Please try to make the title more specific, so that it communicates your actual problem, instead of just a general "help me". Also, please use [code][/code] around commands and code blocks, to preserve formatting and to improve readability.
Last edited by David the H.; 10-11-2010 at 03:59 PM.
Reason: as stated
thanks a lot, I think this is what I needed. So I typed up the script and saved it as a .scr, but how can I test this to run from terminal in Ubuntu? For example I saved it in my /media dir, but I tried to bash filename.scr and tried to sh filename.scr, both came back with no such file or dir
you need to be in the same directory as the file you are trying to run. type " cd blah blah/media " , then run " filename.scr " or " sh filename.scr".
at least i think so, i am a noob.
You didn't just place that command as-is into a file, did you? That probably won't do you much good. Executing it would only do the same thing as running the command itself. You'd have to build in a variable substitution or two at the least in order for it to accept external input.
You also have to change permissions to make the script executable. And the shell must know where to look when launching it. So the directory it's in must be either set in your PATH environment variable, or else the command name must include the path to the file (absolute or relative). ./command is the usual way to call executables from the current directory, for example.
Also, the traditional file extension for shell scripts is .sh, not .scr.
I understand its not your job to teach me.... I also understand its not "common" practice to name a script .scr and to name it .sh My instructor wanted us to name is .scr for what ever reason, I thought it odd as when I tried to write the script in Windows and saved the file as .scr it saved the file as a screenshot.
But I do thank you for the information, it was a great help. I come here because not all the books and online resources are up to date and I prefer using a resource which is up to date.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.