I have a sample file like below. There are leading line spaces. Is there a way to detect them and print the exact line number which contains the line space using shell script?
test space at back
test space at front
TAB at end
TAB at front
I have a sample file like below. There are leading line spaces. Is there a way to detect them and print the exact line number which contains the line space using shell script?
test space at back
test space at front
TAB at end
TAB at front
This works for me ! if grep -n '^ ' config.js /dev/null >&2; then echo "$0: Leading spaces identified above; aborting" >&2 exit 1 fi