Hello people!
I would like to create one script following this stage
I have one directory with 100 files
File001
File002
...
File100
(This is the format of content of the 100 files)
2012/03/10 12:56:50:221875936 1292800448912 12345 0x00 0x04 0
then I have one text file(IMSI.txt) with 5 numbers
12345 (Number A)
12346
12347
12348
12349
I Created this script:
for LINE in `cat /Aldo/IMSI.txt`
do
grep $LINE /Aldo/File*
done | cut -d":" -f2-5 > /home/eir/Desktop/Aldo/encontrados.txt
to find the "numbers A" on the 100 files then print the line like
2012/03/10 12:56:50:221875936 1292800448912 12345 0x00 0x04 0
example: Find 12345 in the 100 files
2012/03/10 12:56:50:221875936 1292800448912 12345 0x00 0x04 0
2012/03/10 12:56:50:221875936 1292859448912 12345 0x00 0x04 0
2012/03/10 12:56:50:221875936 1292898758912 12345 0x00 0x04 0
2012/03/10 12:56:50:221875936 1292823458912 12345 0x00 0x04 0
2012/03/10 12:56:50:221875936 1292898348912 12345 0x00 0x04 0
to now.. all is working good!
but io have another problem... from the 100 files.. i would like to limit the files by date .. as before the March 22... i tried to use find
grep $LINE | find /opt/eir/var/tdr -mtime +22
but allways show me the directory of the file.. and i need the
2012/03/10 12:56:50:221875936 1292859448912 12345 0x00 0x04 0
2012/03/10 12:56:50:221875936 1292898758912 12345 0x00 0x04 0
2012/03/10 12:56:50:221875936 1292823458912 12345 0x00 0x04 0
2012/03/10 12:56:50:221875936 1292898348912 12345 0x00 0x04 0
Help me!
---------- Post updated at 11:25 AM ---------- Previous update was at 11:21 AM ----------
grep $LINE | find /opt/eir/var/tdr is /Aldo/File*