A possible solution :
find your_search_path -mtime -1 -type f -ls | sed 's/://g' | awk '$10 < your-hour_without_: {print $11}' | xargs rm
It workes but,surely, there's abetter way to do it.
Bye,
Gilles
Hi,
$11 means the field #11 of output for "ls -al" (the name of the file).
To complete the Mrjazz solution's, i think you can try :
find your_search_path -mtime -1 -type f -ls | grep 08:30 | awk ´{print $11 }´ | xargs rm
Regards,
Gilles
Why don't you use a curde method with head and tail ?
For example :
#!/bin/ksh
i=1
cat logfailed.sql | while read line
do
case $i in
12) head -26 infile | tail -1 >> outfile
i=`expr $i + 1`
;;
13) head -14 infile | tail -1 >> outfile...
I believe that for several OS, you have a command to display the activity for a process. On Sun, it's truss, on SGI, it's par and for the other i don't remember ...
You may see if there's no Read/write activity.
Good Luck,
Gilles
Hi,
my problem is that i can't have "'" in my output, for example : awk '{printf "'%s'\n",$1}' file
to have something like : 'Field#1'
\',"'","''"... doesn't work (even with command print).
Thanks a lot !
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.