Date: Mon, 15 Sep 2003 13:18:12 -0500 From: "Charles Howse" <chowse@charter.net> To: <mrb@bmyster.com>, <questions@freebsd.org> Subject: RE: drive space shell script help ? Message-ID: <001101c37bb5$b97a1a70$04fea8c0@moe> In-Reply-To: <54020.207.5.142.198.1063648495.squirrel@bmyster.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> #!/bin/sh
> # this is a script to check drive space and email HSD dept.
> #
> cd ~bbailey
> rm ~bbailey/drvspc.txt
> df -k | awk '{print$5}' >~bbailey/drvspc.txt
> cat drvspc.txt
> while read i
> do
> if [$i > '89']; then
This line should be:
if [ $i -gt 89 ] ; then
The spaces between the leading and trailing brackets are mandatory, and
you had 2 spaces between the ; and 'then', and the comparison operator
for integers is '-gt' for 'greater than'. I don't believe you need the
ticks around 89 either.
A great source for help: http://www.tldp.org/LDP/abs/html/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?001101c37bb5$b97a1a70$04fea8c0>
