doc date 19990412

NAME

exchange -- change characters from a list into characters from another list

SYNOPSIS

exchange [ options ] string_arg1 string_arg2 <_standard_redirection_> options

DESCRIPTION

exchange is part of the functionality of the standard unix command tr , split into a separate command (along with pluck and squeeze ) in cLIeNUX for clarity.

exchange changes characters specified by string_arg1 from standard input into the corresponding character in the list specified by string_arg2 and sends the result to standard output. string_args specify ordered lists of ASCII characters. Most characters may represent themselves, and there are aliases for backslash escapes including octal ASCII values, "asciibetical" ranges of characters like A-Z and named character classes. You'll have to use \\ to specify a backslash, for example. See tr for the details.

The complement switch causes the first character list to be to be all the ASCII characters *not* specified by string_arg1.

The truncate switch is for when the first list of characters is longer than the second list. Normally exchange will replicate the last char in the second list to make it as long as the first. With the switch it will instead truncate the first list.

EXAMPLES

These employ Bash "here document" use of << redirection from the prompt.

$exchange a b <<___
> aeubaaabbbataralataha
> ___
beubbbbbbbbtbrblbtbhb

$exchange a-f A-F <<_bla
> ;nuoetkhboua,.uj;otehjbneduxkoeu
> _bla
;nuoEtkhBouA,.uj;otEhjBnEDuxkoEu

SEE ALSO

tr pluck squeeze sed awk/gawk and GNU "info" on gawk, dirname basename

BUGS

I *just* hacked up the little mutant. It still gives on-line help for tr with the --help switch.

RIGHTS

exchange is a derived work of GNU tr. This seedoc is not. This document is Copyright 1999 Richard Allen Hohensee. This seedoc is released for redistribution only as part of an intact entire cLIeNUX Core.