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.
1. List all Zip files in a directory i.e. "/home/Hunter/" and check for files updated in last 10 minutes
2. Grep Pattern i.e. "error" from all the *.zip files updated in last 10 minutes.
3. Send grepped pattern to newfile.log file.
4. Above functinality in a script needs to be scheduled in a cronjob.
Hi All,
I request a shell script for the below task
1. List all Zip files in a directory i.e. "/home/Hunter/" and check for files updated in last 10 minutes
2. Grep Pattern i.e. "error" from all the *.zip files updated in last 10 minutes.
3. Send grepped pattern to newfile.log file.
4. Above functinality in a script needs to be scheduled in a cronjob.
If you want someone to write your scripts/programs for you, then you need to PAY THEM. List this in the LQ Job Marketplace, along with how much you'd pay, and someone may do it.
Just posting something like this is very, VERY rude...why should others do your work for you?? This is a place to come for HELP...that is, you post what YOU have written/tried, and explain where you're stuck. Someone will be more than happy to assist you. But just asking and expecting others to spoon-feed you things is wrong.
Now that you've been appropriately and deservedly chastised, here's what you do. Read enough of the links provided by Habitual, until you've got enough to get a start on your project. When you've got something that looks like a reasonable start, but you just can't get past one or two hurdles, post (in [CODE] [/CODE] tags please) your code here, along with a written description of the problem spot. I'll give you an advance lesson about that last part: "doesn't work" is not a description of the fault. A description should include what it is expected to do, and how it differs from the expected. Looking forward to seeing how you progress.
--- rod.
I don't want to discourage anyone from helping, but the sad truth is that we are not likely to hear from the OP anytime soon. To be sure, it is not the standard, one-post-only, homework troll. But I think it will likely become one of the all too common abandoned threads. My guess is that maybe 2/3 of the threads where I have helped (or observed) lately have been abandoned.
I'm ruminating about a help site that charges an enrollment fee. Said fee would be refunded after the management team is satisfied that the member is "real"
my_files=($( find ~ -mmin -10)) #should get you files in specific location that have changed in past 10 minutes
for i in my_files; do
zcat my_file | grep -i error >> myzip.err
done
of course this is simplified version (I have intentionally left some work) - but hint is good enough to help you all the way.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.