Why is my grep + regex not working?
If you want to use Perl regex syntax you need -P
switch with grep. Check out previously asked guestion here Is grep syntax different from regex?
- You should quote your expression so the shell doesn't interpret it
grep
doesn't have the\d
escape, you'll need to use[0-9]
instead.+
needs to be escaped without the-E
switch.
This should work:
watch cat /proc/mdstat | grep 'finish=[0-9]\+\.[0-9]' | grep '[0-9]\+\.[0-9]'