Saturday, August 1, 2009

Linux command : tr

Use of tr utility:
To translate range of characters into other range of characters.

General Syntax & use of tr utility:
Syntax:
tr {pattern-1} {pattern-2}

Examples
Type the following command at shell prompt:
$ tr "h2" "3x" <>
11 Vivek
1x Renuka
13 Prakas3
14 As3is3
15 Rani

You can clearly see that each occurrence of character 'h' is replace with '3' and '2' with 'x'. tr utility translate specific characters into other specific characters or range of characters into other ranges.
h -> 3
2 -> x

Consider following example: (after executing command type text in lower case)
$ tr "[a-z]" "[A-Z]"
hi i am Vivek
HI I AM VIVEK
what a magic
WHAT A MAGIC

{Press CTRL + C to terminate.}

Here tr translate range of characters (i.e. small a to z) into other (i.e. to Capital A to Z) ranges.



COMMITMENT

Birds that live in a lake and will fly away when the lake dries up... But the lotus in the same lake dies with the lake... that deep should be the commitment in a relationship…

LIFE....

"Every tear of sadness that we shed for a person we love is a capsule of memory that we have to leave behind. We fall in love so that we learn; we get hurt so that we will become strong; and we cry so that we can let go and find our place in the life of someone who will love us the way we have loved.

"So 4give like u have amnesia, believe like a kid, love like crazy, laugh till you fart, never regret anything that made u happy....
"And learn 2 appreciate what u have be4 time forces u to appreciate what u had...4give, learn and love..."


Be simple, big hearth and think everything is possible when you want.
have big dreams but working by them, without ambition.
Help always people need you.
Always forgive, never remember old mistakes.
Try to be better person than yesterday along our life.