bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug report of tr command.


From: Eric Blake
Subject: Re: Bug report of tr command.
Date: Mon, 13 Apr 2009 05:51:19 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to maguowei2723 on 4/13/2009 1:45 AM:
> I want to replace all the word of "root" to "administrator" in test.txt 
> file.I get a bit part of the file:
>  
> 
> yeah,but when I finish the replace by execute command---- tr 'root' 
> 'administrator' < test.txt
> I found the result is not the same with my expected.
>  
> USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
> ammi         1  0.0  0.1   2008   768 ?        Ss   21:03   0:03 /sbin/inii

tr is for character replacement.  You asked it to replace 'o' with 'd',
and also asked it to replace 'o' with 'm', and the latter request won.  If
you want word replacement, you are looking for 'sed', not 'tr'.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAknjJzcACgkQ84KuGfSFAYC/DgCfcL9/82ZFrG7DGxvjHA4cmndN
Q98An3ubEswlG9M1C4mmqmbqLvc7j7fO
=VBVq
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]