I had the following script that I sourced from .bashrc to let me know when I was running out of disk space.
#!/bin/bash df | grep dev | cut -c53-54,56- | while read p1 p2 do if [ $p1 -gt 95 ] then echo "Danger! $p2 is $p1 full!" fi done This worked fine under Mandrake 9.0 and RedHat 8.0. I've just spent 3 tortuous hours determining that sourcing this no longer works. Now I have to simply run it. That is, before where I had source ~/checksize.sh now I must have simply ~/checksize.sh The original method produces this: bash: [: -gt: unary operator expected bash: [: -gt: unary operator expected bash: [: ha: integer expression expected bash: [: oo: integer expression expected bash: [: -gt: unary operator expected The reason that I sourced it originally is that because I was starting a shell script from within .bashrc, I got into an infinite loop. This no longer appears to happen. Why does sourcing no longer work?
Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com