Skip to content

Commit

Permalink
Merge pull request #296 from mknos/tail-n0
Browse files Browse the repository at this point in the history
tail -n: 0 versus +0 versus -0
  • Loading branch information
briandfoy authored Oct 20, 2023
2 parents 9f51eb3 + ec4caea commit b706363
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions bin/tail
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,18 @@ sub parse_args()
usage 1, "-f and -r cannot be used together"
if $opt_f and $opt_r;

$point = check_number($opt_b), $type = "b" if $opt_b;
$point = check_number($opt_c), $type = "c" if $opt_c;
$point = check_number($opt_n), $type = "n" if $opt_n;
if (defined $opt_b) {
$point = check_number($opt_b);
$type = 'b';
}
if (defined $opt_c) {
$point = check_number($opt_c);
$type = 'c';
}
if (defined $opt_n) {
$point = check_number($opt_n);
$type = 'n';
}

for (@ARGV) {
$point = check_number($1), shift @ARGV, last
Expand Down

0 comments on commit b706363

Please sign in to comment.