![]() | |
#41
| |||
| |||
|
|
Matt Probert wrote: On the other hand, something similar could be written in a few lines of Perl and posted here. Okay last to post the (quick and dirty) Perl solution is a sissy! <g Is two lines (excluding shebang) too many? I can do it in one if I'm allowed to change the order of the arguments to STRING, REPLACEMENT, FILESPEC. #!/usr/bin/perl $a = shift @ARGV; system("sed -i 's/" . shift @ARGV . '/' . shift @ARGV . "/g' $a"); (Very dirty. Won't work for some STRINGs -- anything that has a special meaning in a regexp.) |
#42
| |||
| |||
|
|
On Tue, 08 Jun 2004 13:15:12 GMT, Matt Probert comments (AT) probertencyclopaedia (DOT) com> declared in alt.html,alt.html.tags,alt.www.webmaster: English language, it's richness and complete lack of logic! ^ And its wayward apostrophes! :-D |
#43
| |||
| |||
|
|
Will that work under Windows? Looks to me like it's calling an external program - 'sed'. |
#44
| |||
| |||
|
|
On Wed, 9 Jun 2004 09:34:16 +1000 Mark Parnell webmaster (AT) clarkecomputers (DOT) com.au> broke off from drinking a cup of tea at to write: On Tue, 08 Jun 2004 13:15:12 GMT, Matt Probert comments (AT) probertencyclopaedia (DOT) com> declared in alt.html,alt.html.tags,alt.www.webmaster: English language, it's richness and complete lack of logic! ^ And its wayward apostrophes! :-D Touche! I always think (well sometimes) that "its" should have an apostrophe...I know, I know... |
#45
| |||
| |||
|
|
Touche! I always think (well sometimes) that "its" should have an apostrophe...I know, I know... Me too, because you were talking about the richness belonging to "it". So it should be "it's" richness! |
#46
| |||
| |||
|
|
On Tue, 08 Jun 2004 21:24:31 +0100 Toby A Inkster tobyink (AT) goddamn (DOT) co.uk> broke off from drinking a cup of tea at goddamn.co.uk to write: Matt Probert wrote: On the other hand, something similar could be written in a few lines of Perl and posted here. Okay last to post the (quick and dirty) Perl solution is a sissy! <g Is two lines (excluding shebang) too many? I can do it in one if I'm allowed to change the order of the arguments to STRING, REPLACEMENT, FILESPEC. #!/usr/bin/perl $a = shift @ARGV; system("sed -i 's/" . shift @ARGV . '/' . shift @ARGV . "/g' $a"); (Very dirty. Won't work for some STRINGs -- anything that has a special meaning in a regexp.) Will that work under Windows? Looks to me like it's calling an external program - 'sed'. |
#47
| |||
| |||
|
|
Me too, because you were talking about the richness belonging to "it". So it should be "it's" richness! |
|
I had "it's" (in the possessive sense we are discussing here) on a website. Some stuffy guy emailed to point it out, which I then changed. It happens! |
![]() |
| Thread Tools | |
| Display Modes | |
| |