Download as PDF, PPTX






![NAME
cat -- concatenate and print files
!
SYNOPSIS
cat [-benstuv] [file ...]
!
DESCRIPTION
The cat utility reads files sequentially, …
!
The options are as follows:
!
-b Number the non-blank output lines, start-
ing at 1.
!
-e Display non-printing characters (see the
-v option), and display a dollar sign
(`$') at the end of each line.](https://image.slidesharecdn.com/perlpowertools-saintperl6-141221041403-conversion-gate01/85/Perl-Power-Tools-Saint-Perl-6-7-320.jpg)
![while (<>) {
if ($squeeze_empty) {
my $is_empty = /^$/;
if ($is_empty && $was_empty) {
next;
}
$was_empty = $is_empty;
}
!
$_ = sprintf "%6d $_", ++ $count if $number_lines ||
$number_non_blanks && /S/;
!
$_ =~ s/$/$/ if $ends;
if ($nonprinting) {
$_ =~ s/([x80-xFF])/"M-" . ("x7F" & $1)/ge;
$_ =~ s/([x00-x08x0B-x1F])/"^" . chr (0100 + ord $1)/ge;
$_ =~ s/x7F/^?/g;
}
if ($tabs) { $_ =~ s/x09/^I/g; }
!
print;
}](https://image.slidesharecdn.com/perlpowertools-saintperl6-141221041403-conversion-gate01/85/Perl-Power-Tools-Saint-Perl-6-8-320.jpg)




The document provides a comprehensive overview of the Perl power tools, specifically focusing on the 'cat' utility which concatenates and prints files. It details the options available for 'cat', including the ability to number lines and display non-printing characters. Additionally, there are references to related resources and tools within the Perl ecosystem.






![NAME
cat -- concatenate and print files
!
SYNOPSIS
cat [-benstuv] [file ...]
!
DESCRIPTION
The cat utility reads files sequentially, …
!
The options are as follows:
!
-b Number the non-blank output lines, start-
ing at 1.
!
-e Display non-printing characters (see the
-v option), and display a dollar sign
(`$') at the end of each line.](https://image.slidesharecdn.com/perlpowertools-saintperl6-141221041403-conversion-gate01/85/Perl-Power-Tools-Saint-Perl-6-7-320.jpg)
![while (<>) {
if ($squeeze_empty) {
my $is_empty = /^$/;
if ($is_empty && $was_empty) {
next;
}
$was_empty = $is_empty;
}
!
$_ = sprintf "%6d $_", ++ $count if $number_lines ||
$number_non_blanks && /S/;
!
$_ =~ s/$/$/ if $ends;
if ($nonprinting) {
$_ =~ s/([x80-xFF])/"M-" . ("x7F" & $1)/ge;
$_ =~ s/([x00-x08x0B-x1F])/"^" . chr (0100 + ord $1)/ge;
$_ =~ s/x7F/^?/g;
}
if ($tabs) { $_ =~ s/x09/^I/g; }
!
print;
}](https://image.slidesharecdn.com/perlpowertools-saintperl6-141221041403-conversion-gate01/85/Perl-Power-Tools-Saint-Perl-6-8-320.jpg)



