tr equivalent to sed command

fedora fedora at ayni.com
Fri Feb 24 13:12:57 UTC 2012


Try

tr -c  [:alnum:] ....

-c --complement

suomi


On 02/24/2012 01:22 PM, 夜神 岩男 wrote:
> I'm trying to move a script from invoking lots of sed and awk to bash
> builtins and I'm stumped on something I'm sure is simple.
>
> Is there a tr equivalent to the following?
> sed 's/[^[:alnum:]]//g'
>
> I just can't seem to get tr -d to accept a negative matching set, but
> perhaps that's not possible?
>
> Thanks in advance
>
> -IY


More information about the users mailing list