script help - check for empty file
I'm using the find command to check for certain things, and exporting it to a text file.
what i would like to do from within a script, check that file and if it's empty then print success or no problem found. But if there is any thing returned from the find command then echo "hey problem, look in this file". Code:
|
Quote:
There are MANY easily-found scripting tutorials...along with over 365,000 hits for "bash script to find empty files" in Google, which point you to examples. |
On top of the above, have you bothered to look at the man page for find?
|
if i bothered to look at the man page, i would not have bothered posting here asking about it.
|
Quote:
|
thanks
for not helping at all |
Quote:
|
http://www.linuxquestions.org/questi...ommand-726352/
why don't you go post in that thread, tell the guy asking for help to go search the web instead. this is just what i want to do at 9pm at night is scour the web for correct syntax for using find and bash syntax you should just close this whole program forum |
So let me get this straight:
1. You have posted here 247 times (so not new) 2. Above would imply you know how this site works and what sort of things people will come back with 3. You have advised how lazy you are because in your own words :- "if i bothered to look at the man page, i would not have bothered posting here asking about it." 4. Instead of looking at the man page, which I suggested being that you are supposedly an experienced user based on number of posts, you would rather search the forum to point out someone else's post from 6 years ago 5. Hard to tell if the OP in post you have cited had many posts by the time they asked the question, but in answer to yours, yes I would have asked if they had read the man page first, if they say yes then I would point out the prune option and if not (or "I can't be bothered") I would suggest they do before getting help 6. gee 9pm and here i was up all night and answered your post at 5am my time, not sure how this has any bearing on the question 7. closing the forum would only disadvantage those users who actually want help |
Quote:
-- was on that career path we HELP by pointing you in the right DIRECTION ! and YES , a bunch of us DO come off as thin skinned professors with a student in our office that has NOT done the work . |
Quote:
We are not here to spoon-feed you. This is not Burger King. You don't get it your way. Show some maturity. |
ron7000,
The behavior you're exhibiting and language you're using in this thread isn't acceptable here at LQ. You may want to read http://www.linuxquestions.org/questi...#faq_lqwelcome and the LQ Rules again if you're interested in participating here moving forward. --jeremy |
BASH File Test Operators
Have a look at the -s option. Code up a test using that. If you have problems, then post your code and a clear description of your problem as follow-up. I'm hoping that you don't wait till the last minute and get very frustrated for all things you work on. And if you regularly do work at 9 PM, then complaining about putting in effort is the last thing you wish to do at that time is rather non-charitable. Note also that having the forum root point out your bad behavior is embarrassing. Or should be. Instead of getting angrier, please learn from it. I'm likely much older than you and I still feel I learn from people. |
all i needed was some basic code,
in fact all it amounted to was the if then fi syntax using an -s command. if someone posted that code... then someone said hey that's not bad but consider coding it this way and posted some code, is this not a programming forum? it would have helped me. but no, everyone on their high horse like we're in a classroom tells me to look it up on the web and do the work myself. Quote:
here's my mature response, you guys have a nice life. jeremy, you just a lost a member. you can delete my account here, this site is not helping me anymore. feel free to delete anything i have ever posted here, especially if it contained code. btw here's now you help: https://forums.suse.com/showthread.p...g-diff-command |
Quote:
Quote:
Best regards, HMW |
All times are GMT -5. The time now is 11:50 AM. |