#!/bin/bash # 0:stdin 1:stdout 2:stderr 3..9:files like below while read a<&3 && read b<&4 do echo $a $b printf "0x%04d\n" $(echo "obase=16;$((a|b))" | bc) #obase is hexadecimal done 3<a.txt 4<b.txt #**************************************************** Read More