I want to read my files line by line every 5 seconds. This time I just tried one-line bash command to do this. And bash command is:
let X=1;while [ $X -lt 20 ];do cat XXX.file |head -$X|tail -1;X=$X+1;sleep 5;done
However I got the error like:
-bash: [: 1+1: integer expression expected
What's the problem? btw, why can't we do $X < 20? (Instead we have to do -lt, less than?)
thx
readoperator, rather than that cat-head-tail thing? It would be simpler and much less IO-intensive. – Malvolio Aug 18 '11 at 16:30