in reply to Re^2: What does ">>" do? (And other stat questions)
in thread What does ">>" do? (And other stat questions)
The $mode value is 33261. I wanted to show what happens when you print it with the octal formatting string (prints 100755) and when you do it after having modified it with the binary and (&). And & has a higher precedence than the comma. As you can see below, adding parens to guarantee the right precedence does not modify the output::
DB<1> $mode = 33261; DB<2> printf "%04o", $mode; 100755 DB<3> printf "%04o", $mode & 07777; 0755 DB<4> printf "%04o", ($mode & 07777); 0755 DB<5>
|
|---|