By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,761 Members | 940 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,761 IT Pros & Developers. It's quick & easy.

help with date extension file reading

P: 9

I need help with the script below, the if statments are fine they work perfect. what i am looking for is getting the files from the directory /raw/ with the restriction. for example, the filenames under /raw/ directory are,
[HTML][/HTML]I want to get all the files less than the date i type in command line. Also should adapt the script below.
before this modification i was passing the dates through a perl script, which allow the script to process one by one file. where $1 was date passed one at a time.
Any help will be appreciated.
thank you in advance.

echo $1;
ls /raw/abc.bbx.* | while read filename ; do
i dont know what to do next here.
if test -e /raw/$1;
cat /raw/$1 | grep "CN Some" | awk 'NF > 4' >> parsebb.out.1;
if test -e /raw/$1.gz;
gunzip -c /raw/$1.gz | grep "CN Some" | awk 'NF > 4' >> parsebb.out.1;fi

if test -e parsebb.out.1
`tac parsebb.out.1 > tmpparsebb.out.1`;
fi[/HTML]Also is it possible to redirect the file in same file for "tac" or overwriting the file. I have other option to create temp file, but i dont want to create temp file. please help.
Thanks in advance
Feb 27 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.