refactor grep conditions
lint:  fix missing quoting
lint: fix SC2091
lint: fix useless cat
fix indentation
lint: SC2038
lint: fix useless cat