On 12/04/2011 10:04 AM, Fernando de Oliveira wrote: > Hi, > > Running this script I obtain (LFS 6.5, 6.7, small difference in 6.8): > > $ remove-expired-certs.sh > date: data inválida "Jul 31 12:31:40 2038 GMT" > /bin/remove-expired-certs.sh: line 18: [: -lt: esperado operador unário > certs/ad6c2ff9.pem is expired! Removing... > certs/84009bc3.pem is expired! Removing... > date: data inválida "Jul 31 12:29:50 2038 GMT" > /bin/remove-expired-certs.sh: line 18: [: -lt: esperado operador unário > date: data inválida "Dec 31 14:20:24 2040 GMT" > /bin/remove-expired-certs.sh: line 18: [: -lt: esperado operador unário > certs/48ef30f1.pem is expired! Removing... > date: data inválida "Dec 31 14:10:36 2040 GMT" > /bin/remove-expired-certs.sh: line 18: [: -lt: esperado operador unário > certs/972672fc.pem is expired! Removing... > > > where a free translation of the messages could be: > > data inválida = invalid date > esperado operador unário = expecting unary operator > > > []s, > Fernando
The error "esperado operador unário" means that the data contained in the first argument to test either has non-numerical characters, or that it is empty. I'm guessing you are running a 32bit kernel and libc and the 2038 date bug is rearing its head. I suppose we need to dump the test output to /dev/null and put the removal into a second if case based on the return value of test to work around this. 2 is the return value needed to test on. Thanks for the report. I'll get to it in a day or two (I don't have a recent 32bit system to test with right this second). OTOH, it is a good learning experience. We'll undoubtedly see more of this in the coming years (for as long as we support 32bit hosts). If you want to try and fix it yourself, feel free to do so and post the corrected script and we'll get it tested and updated in the book. -- DJ Lucas -- http://linuxfromscratch.org/mailman/listinfo/blfs-support FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page