linux - start - ¿No es compatible con las expresiones básicas de grep?
ls grep (2)
Esto no genera ningún resultado. ¿Cómo?
$ echo ''this 1 2 3'' | grep ''/d/+''
Pero estos hacen:
$ echo ''this 1 2 3'' | grep ''/s/+''
this 1 2 3
$ echo ''this 1 2 3'' | grep ''/w/+''
this 1 2 3
El modo predeterminado de grep es (iirc) POSIX regex, y /d es pcre. Puede pasar -P a gnu grep, para expresiones regulares tipo Perl, o usar [[:digit:]] lugar de /d .
daenyth@Bragi ~ $ echo 1 | grep -P ''/d''
1
daenyth@Bragi ~ $ echo 1 | grep ''[[:digit:]]''
1
Prueba este $ echo ''this 1 2 3'' | grep ''[0-9]/+'' $ echo ''this 1 2 3'' | grep ''[0-9]/+''