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.
Hello group, I need help writing a script, I am sure this can be done as a bash script but if someone wanted to do this in ruby or perl that would work just fine.
What I need to do is take a list of file names from my database, I then need to search in a directory and see if that file actual exists there, if it does not exist I need to be informed somehow.
To Wim Sturkenbooms question you responded you have nothing to show. Now he basically asked for any commands or (pseudo)code you tried, as that makes it easier for us to correct you, after all you asked for help and not somebody writing the script for you. Without any effort on your side it's hard to gauge what we should provide you with and hence I think it's prudent to start at the beginning.
Quote:
Originally Posted by cpatno
WTF.
Friendly advice: you're new here. Be careful who you think you can say that kind of thing to.
*Also it seems you marked his post as "unhelpful". If that's gonna be your attitude towards responses then that needs change.
//Note to all: with posts #6 and #7 the OP has received enough nudges wrt how he should progress. Please no more replies in the same vein.
Last edited by unSpawn; 07-26-2011 at 12:37 PM.
Reason: //More *is* more
Yes, this is the newbie forum. That doesn't mean we will do your work. If you want to write a script read a tutorial about scripting. If you have questions about that you can ask here for further explanation, we will help you with that, but only if you show us that you will do something for yourself. If that isn't what you want feel free to ask for a paid programmer in the LQ Job Marketplace.
note that we have rules here, one of them is that we will not do other people's homework.
We expect that you post some code you have already written for your script. And then if you ask "this does not work, can you help me", you will get help.
btw, nobody here has learned Linux only by asking other people to do his/her work/homework and please note that we are all volunteers, if you need professional help you may (for example) hire a freelancer.
To your question, you did not mention which database you're using, which language/tools you should/would use and so on. Do you have an idea by yourself how to write such a script?
I took Wim's question as "what have you been using up to this point" which is that I haven't. I have acquired this from someone who let this get out of hand so that is why I have nothing working at this point. To the question of what have I tried so far, I have been playing around with different things that I have googled but I have had no luck.
I just don't have scripting experience, my expertise lies in other areas of IT. I know this would take someone all of 2 min to type out but while you guys ride around here on your high horses I will go elsewhere, thanks
If you really, really don't want to read the whole thing, at least check out chapter 9, it says how to check if a file exists there.
One thing about bash scripting is that it has a lot or quirks that newbies don't know about, which causes them to write code that seems to work for their situation but can actually do bad things when given certain types of input. So for that reason, I think that everyone who will be writing a bash script should at least read this:
I just don't have scripting experience, my expertise lies in other areas of IT. I know this would take someone all of 2 min to type out but while you guys ride around here on your high horses I will go elsewhere, thanks
If you have no experience in scripting and also don't want to learn it you should say that to your boss, so that he can assign that task to someone who has experience or the will to learn. It makes no sense at all to come up with a solution that you are 1. not able to understand and 2. not able to maintain, if any changes occur. Has nothing to do with high horses at all.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.