|
#!/bin/sh
DF=/bin/df
GREP=/usr/bin/grep
AWK=/usr/bin/awk
EXPR=/bin/expr
totalsize=0
for memsize in ` $DF | $GREP /dev | $AWK '{print $2}'`
do
echo `$EXPR $totalsize + $memsize`
totalsize = `$EXPR $totalsize + 1`
totalsize = `$EXPR $totalsize + $memsize`
done
echo $totalsize
上面是我写的一个脚本。
执行以后显示
349023
totalsize: not found
totalsize: not found
请教是为什么??
ps: 我是在freebsd下面,shell是csh |
|