Rev 11282 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 11282 | Rev 11292 | ||
---|---|---|---|
Line 2... | Line 2... | ||
2 | tit:replace |
2 | tit:replace |
3 | type:$type_both |
3 | type:$type_both |
4 | syntax:!replace [internal] |
4 | syntax:!replace [internal] ``s1'' by ``s2'' in ``string''\ |
5 |
|
5 | !replace ``obj'' ``ident'' by ``s'' in ``string'' |
6 | mean:String manipulation. <p>\ |
6 | mean:String manipulation. <p>\ |
7 |
|
7 | Under the first syntax, variable substitution is first done on ``string''.\ |
8 | Then all occurences of substring |
8 | Then all occurences of substring ``s1'' are replaced by ``s2''. <br/>\ |
9 | When the keyword |
9 | When the keyword ``internal'' is absent, the Linux utility ``sed'' is called to make the replacements,\ |
10 | therefore regular expressions are accepted in |
10 | therefore regular expressions are accepted in ``s1'' and ``s2''.\ |
11 | Please refer to the man page of |
11 | Please refer to the man page of ``sed'' for details. </p><p>\ |
12 |
|
12 | Under the second syntax, ``obj'' can be ``char'', ``word'', ``item'' or ``line''.\ |
13 | Then the word, item or line identified by |
13 | Then the word, item or line identified by ``ident'' in ``string'' is replaced\ |
14 | by |
14 | by ``s'', after variable substitutions. <br/>\ |
15 |
|
15 | ``ident'' can be a string, in this case all objects (words, items or lines) matching ``ident'' \ |
16 |
|
16 | will be replaced. It can also be a number (positive or negative integer ``n''), preceded\ |
17 | by the word |
17 | by the word ``number''. In this case the object number ``n'' will be replaced.\ |
18 | (In the case where n<0, it is the last -n th object which is replaced.)\ |
18 | (In the case where n<0, it is the last -n th object which is replaced.)\ |
19 | </p> |
19 | </p> |