Re: Elaborazione logica di stringhe tramite bash
Alle 08:21 di mercoledì 28 gennaio 2009, Federico Di Gregorio ha scritto:
> Il giorno mer, 28/01/2009 alle 01.37 +0100, Giovanni "Ivan" Alberotanza
>
> ha scritto:
> > man awk
>
> Tutti prima o poi ci siamo presi il piacere di rispondere solo con la
> man page ma ti spiacerebbe chiarire (basta la riga) dove accidenti nel
> manuale di awk si parla di operazioni bit a bit tra il contenuto di due
> file? (Anche perché non mi sembra che la tabella degli operatori
> contenga and, or, not, etc.)
>
> federico
Bit Manipulations Functions
Starting with version 3.1 of gawk, the following bit manipulation
func-
tions are available. They work by converting double-precision
floating
point values to uintmax_t integers, doing the operation, and then
con-
verting the result back to floating point. The functions are:
and(v1, v2) Return the bitwise AND of the values provided by
v1
and v2.
compl(val) Return the bitwise complement of val.
lshift(val, count) Return the value of val, shifted left by
count
bits.
or(v1, v2) Return the bitwise OR of the values provided by
v1
and v2.
rshift(val, count) Return the value of val, shifted right by
count
bits.
xor(v1, v2) Return the bitwise XOR of the values provided by
v1
and v2.
Poi ovvio che ci si deve giocare un po' con shift.
A.
Reply to: