Re: Bug in polnish epilog script
On Sun, Jul 27, 2003 at 07:07:01PM +0200, Marcin Owsiany wrote:
> On Sun, Jul 27, 2003 at 05:28:20PM +0200, Frank Lichtenheld wrote:
> > #!/bin/sh
> > -sed -e "s/,,/\„/g; s/''/\”/g;" $1 > temp
> > +perl -p -e "s/(^|\s),,/\„/g; s/''/\”/g;" $1 > temp
> > mv temp $1
> >
> > I replaced sed with perl because I don't know how to write this
> > regex in sed :)
>
> If perl is used, then it would be best to do it this way:
>
> ------------------------------------------
> #!/usr/bin/perl -pi
> s/(^|\s),,/\„/g;
> s/''/\”/g;
> ------------------------------------------
>
> This way we don't assume that working directory is writable (not that it
> matters much), and it's cleaner and more flexible.
Not that I know Perl...
Since this is a patch to a shell script file, Marcin's intent can be
better served by following patch, I think:
-sed -e "s/,,/\„/g; s/''/\”/g;" $1 > temp
+perl -pi -e "s/(^|\s),,/\„/g; s/''/\”/g;" $1
Of cource I like source to be written in something
like „text”
than ,,text''.
I know it is a pain to type. Bartosz, hello :-) We do not need to
start. I can live as is.
Osamu
Reply to: