Need help writing a script
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. Thanks in advance. |
So what did you come up with till now?
|
Quote:
|
Bash scripting guides
Code:
function help() { echo "Bash scripting guides: |
Quote:
|
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:
*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. |
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.
|
Hello cpatno, welcome to LQ,
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? Markus |
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.
|
Quote:
|
Quote:
Quote:
|
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
|
What's wrong with learning? This is a really good tutorial:
http://linuxcommand.org/writing_shell_scripts.php 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: http://mywiki.wooledge.org/BashPitfalls |
Quote:
Markus |
Quote:
|
All times are GMT -5. The time now is 07:20 AM. |