line=$(grep "# rvm line" ~/.bashrc)
if [ ! -n "$line" ]; then
echo "found"
else
echo "not found"
fi
What's wrong with my quotes in the first line?
EDIT: The problem is set -o errexit, which I use in my script. I suppose -n is treated as an error, exiting the following processes. How can I overcome this, keeping the error check? (Alternatives to -n could work too).
#!/bin/bash -xor useset -vxand examine the output...-nwrongly, means True if string is not empty and then you negate that using!