Question: I want perform sha1sum `file1` and sha1sum `file2` and perform bitwise OR operation with them using bash. Output should be printable i.e 53a23bc2e24d039 ... (160 bit)

How can I do this?

I know

echo $(( 0xa | 0xb )) but how to extend to 40 hexadecimal digits?

Thanks

Answer: 
Try this:

```
val1=$(sha1sum file1)
val1=${val1% *}
val2=$(sha1sum file2)
val2=${val2% *}
val3=$(( 0x$val1 | 0x$val2 ))
printf "%x\n" $val3

```
you can use gawk

```
sha1sum file1 file2 | awk '{sh1=$1;getline;sh2=$1;print or(sh1,sh2);exit}'

```