mirror of
https://github.com/ctm/executor.git
synced 2024-12-02 18:49:41 +00:00
28 lines
388 B
Perl
28 lines
388 B
Perl
|
#!/usr/bin/perl
|
||
|
|
||
|
# useage:
|
||
|
# subst.pl pattern:file ...
|
||
|
|
||
|
while (<STDIN>)
|
||
|
{
|
||
|
@args = @ARGV;
|
||
|
|
||
|
foreach $arg (@args)
|
||
|
{
|
||
|
($current_pattern, $current_file) = split (':', $arg);
|
||
|
if (/$current_pattern/)
|
||
|
{
|
||
|
open (F, $current_file) || die $!;
|
||
|
while (<F>)
|
||
|
{
|
||
|
print $_;
|
||
|
}
|
||
|
close (F);
|
||
|
goto end_line;
|
||
|
}
|
||
|
}
|
||
|
print $_;
|
||
|
end_line:
|
||
|
}
|
||
|
|