#!/bin/bash # script to demonstrate bug with grep v3.10, v3.9 and v3.8 correctly match the expected string grep_string=$(echo 'dev tun123' | grep -P -o -m 1 '[^\d]+') echo "expected string matched is 'dev tun' actual string matched is '${grep_string}'"