Quote:
Originally Posted by waddles
...appending those characters to whatever is in COPY would guarantee the length ${#OUT} is greater than 1, regardless, wouldn't it?...
|
You could be right ( sorry should have looked at the whole code not just the odd character ), its common to add a character to a string in bash so that you don't get null string errors ie
Code:
if [ X${SOMESTRING} = "X" ];then
echo "String is empty or null but doesn't generate an error
fi
The two 'X's cancel out.
So the coder MAY have just tacked this character on to the end of the string in which case the string would be greater than one if curl had downloaded something and have a length of 1 if not, personally I would do a check for an empty/null string but that's just personal preference.
Try replacing the odd character with say 'X' and run the script if it behaves as it should then that is the reason for the odd character.