From mboxrd@z Thu Jan 1 00:00:00 1970 To: "zsh" Message-ID: <20060406140743.3300@henman-np.b-eng.it.to-be.co.jp> From: "djh " Date: Thu, 06 Apr 2006 14:07:43 cc: Subject: Bitwise ops in a conditional X-Seq: zsh-users 10141 This should be fairly simple, but I missed something. I want to test if a shell variable is odd or not in a conditional to generate a simple odd/even testing which seems natural to me. I did the below: if [[ ((index & 0x01)) .eq 1 ]] then print "odd index processing" else print "even index processing fi Actually I thought that a simple if [[ index & 0x01 ]] should work, but conditionaly may requie 2 args? Any suggestions of using binary operators in conditions would be appreciated. Thanks, Darel Henman