How to get one complete column in mysql?
If you remove all newlines and whitespace from the output before grepping, it should work for you.

Use

mysql -u root -pxxxxxxxxx -e "show slave status\G;" 2&gt;&amp;1 | tr -d '\n\r \t' | grep -v "Warning: Using a password" | grep "Last_Error"


where the tr command removes the newline, carriage return, space, and tab characters from the input.