#!/bin/csh @ cows = 4 - 3 + 1 echo $cows
This simple csh script on startup creates a "0" for output when I expect a "2".
~root: csh simple.1 0
I made a bunch of looks, and the only thing I could think of was that the β-β was read as a unary negation, not a subtraction, so changing the operatorβs priority and ending with 4-4, not 2 + 1. Is that right? If so, why? If not ... help!
Edit: that means they are associative right! These operators are NOT associative in C, right? Is C-Shell different from C?
operators csh
Instantsoup Jun 17 '09 at 23:43 2009-06-17 23:43
source share