#!/bin/bash response = `i2cget -y 1 0x18 0x05` upper_byte = $(($response & 0x00FF)) echo response echo upper_byte