bash tr command code example
Example 1: tr replace char for string
#Use sed for replacing a char witha string as in following example:
echo "a~b" | sed 's/~/==/g'
Example 2: tr command
tr command replaces input chars for respective translated chars. Example:
echo 'dcba' > file.txt
tr 'abcd' '1234' < file.txt
4321