error in a variable
Hi,
Someone could help me with these sentence? Code:
per=`print "scale=2; $sum/$count" | bc` Code:
(standard_in) 1: parse error |
what will
print "scale=2; $sum/$count" respond? (without backticks and pipe and bc) |
OP: Do you really have a command named 'print'.
Code:
which print |
If this is a script of some type, perhaps you can post the rest of it, because where are $sum and $count defined?
|
The use of print suggests that the OP has a script written for ksh, the Korn Shell.
The syntax error arises when it is run in another shell such as bash. |
I wonder if they intended to use print or perhaps they chose it due to C programming and not realizing that it's not the same in the shell. @OP if your intention was to output the result of that computation, a better choice here would be echo. What would also help would be to overview what you're doing, or trying to accomplish, what script type you're using, and so forth.
|
All times are GMT -5. The time now is 12:48 PM. |