On Sun, 2003-03-30 at 17:58, Guy Rouillier wrote: > 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?
That is rather strange, Guy - just as a side note, though, have you checked all your lib path and system path statements? -- Mon Mar 31 05:30:01 EST 2003 05:30:01 up 9 days, 17:17, 2 users, load average: 0.52, 0.23, 0.18 ------------------------------------------------------------------ | __ __ | kuhn media australia | | / ,, /| |'-. | http://kma.0catch.com | | .\__/ || | | |=================================| | _ / `._ \|_|_.-' | stephen kuhn | | | / \__.`=._) (_ | email: [EMAIL PROTECTED] | | |/ ._/ |"""""""""| | email: [EMAIL PROTECTED] | | |'. `\ | | | icq: 5483808 | | ;"""/ / | | | | | smk ) /_/| |.-------.| | mobile: 0410-728-389 | | ' `-`' " " | Berkeley, New South Wales, AU | ------------------------------------------------------------------ linux user:267497 * MDK 9.1 * PC/Mac/Linux/Networking/Consulting machine no:194239 * RH 7.3 * Sales - Service - Support - Tutor ------------------------------------------------------------------ ** This messages was composed on a 100% Microsoft free computer ** A true beanie should have a propellor on the top. (alt.fan.pratchett)
Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com