Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BIG QUESTION???

Status
Not open for further replies.

soloxis

MIS
Feb 11, 2002
23
AU
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
 
What is your O/S ? Is it AIX ?

I just copied it to my AIX SP Control-workstation and it worked without error.

Bill.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top