Checked variables work ok in bash