I have a while loop to determine if user entered a new line and will exit once the user enters anything but a new line with the following snippet:
...
while [$abc -e ""]
do
read -p " enter something besides new line " abc
done
...
Say the user presses 'Enter' 4 times followed by 'someNonNewLineString' the output will be
enter something besides new line
enter something besides new line
enter something besides new line
enter something besides new line
line 1 [someNonNewLineString: command not found
from a control perspective, it works the way as expected as this loop is exited once the user enters anything besides 'Enter' but why is that last statement returned saying command not found?
also, is this the right way of approaching this (detect if user entered new line, if yes, re prompt for something else)?