store pattern in variable to keep compatibility through bash versions