in reply to question on sed
## warn if we get an abnormal exit status system ("sed -e 's[$c][$b]g' $File1 > $Replace_html") == 0 or warn "sed had problems (exit val $?)\n";
Try this instead as escaping the slashes should do the trick
You also might want to check that $File1 exists and is readable as $Replace_html won't be empty if sed exits normally.(my $search = $c) =~ s[/](\\/)g; (my $replace = $b) =~ s[/](\\/)g; system("sed -e 's/$search/$replace/g' $File1 > $Replace_html") == 0 warn "sed had problems (exit val $?)\n";
_________
broquaint
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: question on sed
by LameNerd (Hermit) on May 15, 2003 at 16:46 UTC | |
|
Re: Re: question on sed
by Anonymous Monk on May 15, 2003 at 16:24 UTC |