mirror of
https://github.com/ctm/executor.git
synced 2024-11-30 05:51:22 +00:00
28 lines
388 B
Perl
Executable File
28 lines
388 B
Perl
Executable File
#!/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:
|
|
}
|
|
|