I tried to write a program to see if the count divisible by 2 without a remainder Here is my program
count=$((count+0))
while read line; do
if [ $count%2==0 ]; then
printf "%x\n" "$line" >> file2.txt
else
printf "%x\n" "$line" >> file1.txt
fi
count=$((count+1))
done < merge.bmp
This program doesnt work its every time enter to the true