I am trying to capture the last space and what follows it line by line using grep.
This will capture my first space:
echo "toto tata titi" | grep -o " .*$"
In Java, I would use a non-greasy operator, but it does not work:
echo "toto tata titi" | grep -o " .*?$"
He does not return anything
Expected Result titi.
source
share