2 added 105 characters in body
source | link

+ in grep need to be escaped to take effect. Instead of

echo abc123 | grep -o [a-z][0-9]+$

You need to write

echo abc123 | grep -o '[a-z][0-9]\+$'

There are other characters that need to be escaped as well. It is also good practice to put your regex in single quotes.

You can also use egrep which is a synonym of grep -E and uses Extended RE, as commented by @muru.

+ in grep need to be escaped to take effect. Instead of

echo abc123 | grep -o [a-z][0-9]+$

You need to write

echo abc123 | grep -o '[a-z][0-9]\+$'

There are other characters that need to be escaped as well. It is also good practice to put your regex in single quotes.

+ in grep need to be escaped to take effect. Instead of

echo abc123 | grep -o [a-z][0-9]+$

You need to write

echo abc123 | grep -o '[a-z][0-9]\+$'

There are other characters that need to be escaped as well. It is also good practice to put your regex in single quotes.

You can also use egrep which is a synonym of grep -E and uses Extended RE, as commented by @muru.

1
source | link

+ in grep need to be escaped to take effect. Instead of

echo abc123 | grep -o [a-z][0-9]+$

You need to write

echo abc123 | grep -o '[a-z][0-9]\+$'

There are other characters that need to be escaped as well. It is also good practice to put your regex in single quotes.