repo.or.cz
/
hband-tools.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
rewrite header.sed in perl because sed wont handle multiple files for me
[hband-tools.git]
/
user-tools
/
header
blob
0d06ac6587be7ec0d223b8068b243c1c42717f82
1
#!/usr/bin/env perl
2
3
=pod
4
5
=head1 NAME
6
7
header - Echo the input stream up to the first empty line (usual end-of-header marker)
8
9
=head1 SYNOPSIS
10
11
header <FILE> [<FILE> [<FILE> [...]]]
12
13
=cut
14
15
16
for
my
$idx
(
0
..
$#ARGV
)
17
{
18
my
$path
=
$ARGV
[
$idx
];
19
open my
$fh
,
'<'
,
$path
;
20
while
(<
$fh
>)
21
{
22
last if
/^\r?\n?$/
;
23
print
;
24
}
25
if
(
$idx
<
$#ARGV
)
26
{
27
print
"
\n
"
;
28
}
29
}