Shell Script Remove Last Character Of String Java