1.\" Copyright (c) 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" This code is derived from software contributed to Berkeley by 5.\" the Institute of Electrical and Electronics Engineers, Inc. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions --- 19 unchanged lines hidden (view full) --- 28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33.\" SUCH DAMAGE. 34.\" 35.\" @(#)tr.1 8.1 (Berkeley) 6/6/93 |
36.\" $FreeBSD: head/usr.bin/tr/tr.1 81622 2001-08-14 10:01:54Z ru $ |
37.\" 38.Dd October 11, 1997 39.Dt TR 1 40.Os 41.Sh NAME 42.Nm tr 43.Nd translate characters 44.Sh SYNOPSIS --- 199 unchanged lines hidden (view full) --- 244.Pp 245.D1 Li "tr \*q[:lower:]\*q \*q[:upper:]\*q < file1" 246.Pp 247Strip out non-printable characters from file1. 248.Pp 249.D1 Li "tr -cd \*q[:print:]\*q < file1" 250.Sh COMPATIBILITY 251System V has historically implemented character ranges using the syntax |
252``[c-c]'' instead of the ``c-c'' used by historic 253.Bx 254implementations and |
255standardized by POSIX. 256System V shell scripts should work under this implementation as long as 257the range is intended to map in another range, i.e. the command 258``tr [a-z] [A-Z]'' will work as it will map the ``['' character in 259.Ar string1 260to the ``['' character in 261.Ar string2 . 262However, if the shell script is deleting or squeezing characters as in --- 42 unchanged lines hidden --- |