tr equivalent to sed command

Anthony Messina amessina at messinet.com
Fri Feb 24 13:59:29 UTC 2012


On 02/24/2012 06:22 AM, 夜神 岩男 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


aa="%1#2 at 3abc"; echo "${aa//[^[:alnum:]]}"

-- 
Anthony - http://messinet.com - http://messinet.com/~amessina/gallery
8F89 5E72 8DF0 BCF0 10BE 9967 92DC 35DC B001 4A4E

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.fedoraproject.org/pipermail/users/attachments/20120224/c8108fae/attachment.sig>


More information about the users mailing list