yes that was the problem.
BUT, a new prob now.. the loop becomes weird...
now all the files are getting deleted and only one file remains, with the filename "-"
maybe because i am constantly changing the contents of the working directory, it seems everytime the name is changed, the loop thinks it is a new item added and finally, there is only one file left. This is probably a logical error.
In fact i had earlier tried to rename the files using python.. and exactly the same thing happend!! i don't know what the problem is but its definaltely a logical error.
heres the python code if u wnat to look a it:
---------- Post updated at 01:44 PM ---------- Previous update was at 01:40 PM ----------
k man.. im beat.. thanks a lot ryan for everything, ill look into this later.. if you can, try to run the both the shell script as well as the python script on test file.. thanks again though..
funny thing is, the python script actually works if i run it twice!! but the prob is.. it deletes everything except for that last file.
DONE!! Give me feedback ppl.. let me know how this works..
ok guys the prob was that i was changing the files in the folder itself so the loop was getting messed up.. i reworte it using a souce dir and a target dir and it worked like a charm..w00t
Last edited by abhigyan91; 07-22-2009 at 05:22 AM..
Reason: now it sorts into albums too...:)
Hi All,
Good morning
I have a below code which is working & getting expected output. the problem in this code is it is executing 3 if conditions, my requirement is
suppose if first condition is success then it should print echo statement & exit from if condition
else if the 1st if condition... (4 Replies)
Hi,
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.94 Safari/537.36
How can I grep for the strings chrome and safari from a file, and if chrome print Chrome/40.0.2214.94 to a file and also count the number of times chrome is found?
... (4 Replies)
Hi I have the server.log file as:
Server Stopped
ABC
DEF
GHI
JKL
Server Started
MNO
PQR
STU
Server Stopped
VWX
YZ
ABC
Server Started
Server Stopped
123
456
789 (9 Replies)
I have this code
TrackingId:1362412470675;MSISDN:; INFO - number of clietns:3:Received response is: EMSResponse , protocolVersion=5, purchaseOptions=null, serviceData=ServiceData , screenData=CanvasData ]], title=null, titleResource=MessageResource], screenType=null]], serviceId=idBamboo,... (7 Replies)
I have a script that periodically checks the Apache error_log to search for a specific error that causes it to hand and, if found, it restarts the service.
I recently found another error that forces it to hand and won't serve pages until it is reset. What I'm trying to do is to get the script to... (3 Replies)
Hi,
Can any one pelase tell me how to grep multiple strings from multiple files in a singel folder?
grep -E "string1|string2|string3|string4|string..."
its taking lots of time..
can any please tell me fast grep???
URGENT (10 Replies)
hi all,
from a shell (ksh) script, i am doing a 'grep'. how do i find out the number of lines returned from that 'grep' command ??
thanks in advance. (4 Replies)
When I do the following :
grep -l "string" *,
I get a list of file names returned. Is there a way to copy the files returned from the list into another directory ?.
Thanks. (4 Replies)