The
tr command deletes or substitutes characters from standard input and writes the result to standard output.
If you execute the command "tr 'Console' 'DEBUG'", you substitute characters 'C','o','n','s','o','l','e' by 'D','E','B','U','G','',''
For example :
Input: La Console systeme
Output: La DGBUGle UyUteme
Use
sed or
perl:
Code:
sed "s/$wordtosearch/$wordtoreplace/g" input_file > temp_file
mv temp_file input_file
perl -p -i -e "s/$wordtosearch/$wordtoreplace/g" input_file
If the character '/' is part of one of the two strings (search or replace), you must change it by another, for example :
Code:
sed "s!$wordtosearch!$wordtoreplace!g" input_file > output_file