En regardant le man, tu te rendras compte que and est une gnuserie : pas portable même si pratique.
Bit Manipulations Functions
Starting with version 3.1 of gawk, the following bit manipulation functions are available. They work by converting double-precision
floating point values to unsigned long integers, doing the operation, and then converting the result back to floating point. The func-
tions are:
and(v1, v2) Return the bitwise AND of the values provided by v1 and v2.
83 en hexa: = 53, soit en binaire 0101 0011
99 en hexa => 63, soit en binaire 0110 0011
0x02 2 en binaire => 0000 0001
0x04 en binaire => 0000 0010
Son truc c'est un masque sur les deux derniers bits, et vérification que ceux-ci sont bien à 1, la partie supérieure n'a apparamment pas de signification pour le test qui t'intéresse.
A sa place j'aurais fait un truc du genre :
gauthier ~ 17:13 :$ son_programme /donne/en/entree | awk ' and(2,3ドル) = 3'
# man est ton ami
Posté par totof2000 . En réponse au message Problème avec awk. Évalué à 5.
En regardant le man, tu te rendras compte que and est une gnuserie : pas portable même si pratique.
Bit Manipulations Functions
Starting with version 3.1 of gawk, the following bit manipulation functions are available. They work by converting double-precision
floating point values to unsigned long integers, doing the operation, and then converting the result back to floating point. The func-
tions are:
83 en hexa: = 53, soit en binaire 0101 0011
99 en hexa => 63, soit en binaire 0110 0011
0x02 2 en binaire => 0000 0001
0x04 en binaire => 0000 0010
Son truc c'est un masque sur les deux derniers bits, et vérification que ceux-ci sont bien à 1, la partie supérieure n'a apparamment pas de signification pour le test qui t'intéresse.
A sa place j'aurais fait un truc du genre :
gauthier ~ 17:13 :$ son_programme /donne/en/entree | awk ' and(2,3ドル) = 3'