I had problems with 'sed' when I started the original script. The issue I ran into was that sed was making changes to characters that were the results of a previously executed sed.
This is indeed a problem. It is possible, to use a two-step approach by "protecting" the characters you have already changed:
Suppose, you want to change "x" to "yz" and "y" to "ab" - you will have to distinguish between the "y"s from the original text and the "y"s from your first translation. Simply append or prepend a character you don't use normally to signify already translated characters. Basically this is called "escaping" and traditionally the backslash "\" is used for that.:
"x" -> "\y\z", "y" -> "\a\b"
You can now refine your search string to search and translate only for characters not prepended by a "\":
Of course you have to finally - as the very last step - to remove all the backslashes. Now that in sed code, which uses "\" for escaping too - even for escaping "\" themselves:
As you see you need two rules for every character you want to translate: one for the character at the beginning of a line and one for everywhere else.
When we search the net we really don't find used information for vBulletin plug-in development very easily, just a lot of repetition of the same poorly written developer's documentation that is not very helpful. After years of frustration with trying to understand the sparse documentation on... (0 Replies)
Hi everebody!
Somebody tell me what this command does? : ( ) { : | : & } ; :
Attention: do not execute this command 'cause your machine crash down!
Thanks a lot. (6 Replies)
Hello All,
I am trying to write a script when executed, asks you for the password, and confirm password; it should save to a file and also entered password should not be in clear text on the console - should be as ****
Can somebody give me direction in writing this in shell?
Thanks
Chiru (4 Replies)