Hi,
Any one know why if I run a script who contain "echo" (even if used only to return a value), the script it's stall at the specific line who contain this word. For example I try to run this script:
#!/bin/ksh
x=0
y=0
for i in `ps aux -v "%CPU"|grep -v kproc|awk {'print $3'}`
do
x=`echo "scale=2;$x+$i"|bc -l`
y=`expr $y + 1`
done
z=0
for i in `ps aux -v "%CPU"|grep -v kproc|awk {'print $4'}`
do
z=`echo "scale=2;$z+$i"|bc -l`
done
echo "Total processes: $y"
echo "Total RAM resources: $z"
echo "Total CPU resources: $x"
and the errors are on the line with echo word:
Total processes: 7
Total RAM resources: syntax error on line 1, /usr/lib/lib.b
Total CPU resources: syntax error on line 1, /usr/lib/lib.b
Please help me,
Thanx
Any one know why if I run a script who contain "echo" (even if used only to return a value), the script it's stall at the specific line who contain this word. For example I try to run this script:
#!/bin/ksh
x=0
y=0
for i in `ps aux -v "%CPU"|grep -v kproc|awk {'print $3'}`
do
x=`echo "scale=2;$x+$i"|bc -l`
y=`expr $y + 1`
done
z=0
for i in `ps aux -v "%CPU"|grep -v kproc|awk {'print $4'}`
do
z=`echo "scale=2;$z+$i"|bc -l`
done
echo "Total processes: $y"
echo "Total RAM resources: $z"
echo "Total CPU resources: $x"
and the errors are on the line with echo word:
Total processes: 7
Total RAM resources: syntax error on line 1, /usr/lib/lib.b
Total CPU resources: syntax error on line 1, /usr/lib/lib.b
Please help me,
Thanx