⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mmuegel

📁 < linux网络编程工具>>配套源码
💻
📖 第 1 页 / 共 5 页
字号:
X           {
X              warn "${Script_Name}: no version information available, sorry\n";
X           }
X           exit (-1);
X        }
X
X        elsif (($_ = $ARGV[0]) =~ /^-(.)(.*)/)
X        {
X           ($first,$rest) = ($1,$2);
X           $pos = index($argumentative,$first);
X
X           $Switch_To_Order {$first} = join ($;, split (/$;/, $Switch_To_Order {$first}), ++$Order);
X
X           if($pos >= $[) 
X           {
X               if($args[$pos+1] eq ':') 
X               {
X                   shift(@ARGV);
X                   if($rest eq '') 
X                   {
X                       $rest = shift(@ARGV);
X                   }
X
X                   eval "\$opt_$first = \$rest;";
X                   eval "push (\@opt_$first, \$rest);";
X                   push (@Split_ARGV, $first, $rest);
X               }
X               else 
X               {
X                   eval "\$opt_$first = 1";
X                   eval "push (\@opt_$first, '');";
X                   push (@Split_ARGV, $first, "");
X
X                   if($rest eq '') 
X                   {
X                       shift(@ARGV);
X                   }
X                   else 
X                   {
X                       $ARGV[0] = "-$rest";
X                   }
X               }
X           }
X
X           else 
X           {
X               # Save any other switches if $Pass_Valid
X               if ($Pass_Invalid)
X               {
X                  push (@current_leftovers, $first);
X               }
X               else
X               {
X                  warn "${Script_Name}: unknown option: $first\n";
X                  ++$errs;
X               };
X               if($rest ne '') 
X               {
X                   $ARGV[0] = "-$rest";
X               }
X               else 
X               {
X                   shift(@ARGV);
X               }
X           }
X        }
X
X        else
X        {
X           push (@leftovers, shift (@ARGV));
X        };
X
X        # Save any other switches if $Pass_Valid
X        if ((@current_leftovers) && ($rest eq ''))
X        {
X           push (@leftovers, "-" . join ("", @current_leftovers));
X           @current_leftovers = ();
X        };
X    };
X
X    # Automatically print Usage if a warning was given
X    @ARGV = @leftovers;
X    if ($errs != 0)
X    {
X       warn $Usage;
X       return (0);
X    }
X    else
X    {
X       return (1);
X    }
X       
}
X
1;
SHAR_EOF
chmod 0444 libs/newgetopts.pl ||
echo 'restore of libs/newgetopts.pl failed'
Wc_c="`wc -c < 'libs/newgetopts.pl'`"
test 7024 -eq "$Wc_c" ||
	echo 'libs/newgetopts.pl: original size 7024, current size' "$Wc_c"
fi
# ============= libs/strings1.pl ==============
if test -f 'libs/strings1.pl' -a X"$1" != X"-c"; then
	echo 'x - skipping libs/strings1.pl (File already exists)'
else
echo 'x - extracting libs/strings1.pl (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'libs/strings1.pl' &&
;# NAME
;#    strings1.pl - FUN with strings #1
;#
;# NOTES
;#    I wrote Format_Text_Block when I just started programming Perl so
;#    it is probably not very Perlish code. Center is more like it :-).
;#
;# AUTHOR
;#    Michael S. Muegel (mmuegel@mot.com)
;#
;# RCS INFORMATION
;#    mmuegel
;#    /usr/local/ustart/src/mail-tools/dist/foo/libs/strings1.pl,v 1.1 1993/07/28 08:07:19 mmuegel Exp
X
package strings1;
X
;###############################################################################;# Center
;#
;# Center $Text assuming the output should be $Columns wide. $Text can span
;# multiple lines, of course :-). Lines within $Text that contain only 
;# whitespace are not centered and are instead collapsed. This may save time 
;# when printing them later.
;#
;# Arguments:
;#    $Text, $Columns
;#
;# Returns:
;#    $Centered_Text
;###############################################################################
sub main'Center
{
X   local ($_, $Columns) = @_;
X   local ($*) = 1;
X
X   s@^(.*)$@" " x (($Columns - length ($1)) / 2) . $1@eg;
X   s/^[\t ]*$//g;
X   return ($_);
};
X
;###############################################################################
;# Format_Text_Block
;#
;# Formats a text string to be printed to the display or other similar device.
;# Text in $String will be fomratted such that the following hold:
;#
;#    + $String contains the (possibly) multi-line text to print. It is
;#	automatically word-wrapped to fit in $Columns. 
;#
;#    + \n'd are maintained and are not folded.
;#
;#    + $Offset	is pre-pended before each separate line of text. 
;#
;#    + If $Offset_Once	is $TRUE $Offset will only appear on the first line.
;#      All other lines will be indented to match the amount of whitespace of
;#      $Offset.
;#
;#    + If $Bullet_Indent is $TRUE $Offset will only be applied to the begining
;#      of lines as they occured in the original $String. Lines that are created
;#      by this routine will always be indented by blank spaces.
;#
;#    + If $Columns is 0 no word-wrap is done. This might be useful to still
;#      to offset each line in a buffer.
;#
;#    + If $Split_Expr is supplied the string is split on it. If not supplied
;#      the string is split on " \t\/\-\,\." by default.
;#
;#    + If $Offset_Blank is $TRUE then empty lines will have $Offset pre-pended
;#      to them. Otherwise, they will still empty.
;#
;# This is a realy workhorse routine that I use in many places because of its
;# veratility.
;#
;# Arguments:
;#    $String, $Offset, $Offset_Once, $Bullet_Indent, $Columns, $Split_Expr,
;#    $Offset_Blank
;#
;# Returns:
;#    $Buffer
;###############################################################################
sub main'Format_Text_Block
{
X   local ($String, $Real_Offset, $Offset_Once, $Bullet_Indent, $Columns, 
X      $Split_Expr, $Offset_Blank) = @_;
X
X   local ($New_Line, $Line, $Chars_Per_Line, $Space_Offset, $Buffer,
X      $Next_New_Line, $Num_Lines, $Num_Offsets, $Offset);
X   local ($*) = 0;
X   local ($BLANK_TAG) = "__FORMAT_BLANK__";
X   local ($Blank_Offset) = $Real_Offset if ($Offset_Blank);
X
X   # What should we split on?
X   $Split_Expr = " \\t\\/\\-\\,\\." if (! $Split_Expr);
X
X   # Pre-process the string - convert blank lines to __FORMAT_BLANK__ sequence
X   $String =~ s/\n\n/\n$BLANK_TAG\n/g;
X   $String =~ s/^\n/$BLANK_TAG\n/g;
X   $String =~ s/\n$/\n$BLANK_TAG/g;
X
X   # If bad $Columns/$Offset combo or no $Columns make a VERRRYYY wide $Column
X   $Offset = $Real_Offset;
X   $Chars_Per_Line = 16000 if (($Chars_Per_Line = $Columns - length ($Offset)) <= 0);
X   $Space_Offset = " " x length ($Offset);
X
X   # Get a buffer
X   foreach $Line (split ("\n", $String))
X   {
X      $Offset = $Real_Offset if ($Bullet_Indent);
X
X      # Find where to split the line
X      if ($Line ne $BLANK_TAG)
X      { 
X         $New_Line = "";
X         while ($Line =~ /^([$Split_Expr]*)([^$Split_Expr]+)/)
X         {
X            if (length ("$New_Line$&") >= $Chars_Per_Line)
X            {
X               $Next_New_Line = $+;
X               $New_Line = "$Offset$New_Line$1";
X               $Buffer .= "\n" if ($Num_Lines++);
X               $Buffer .= $New_Line;
X               $Offset = $Space_Offset if (($Offset) && ($Offset_Once));
X               $New_Line = $Next_New_Line;
X               ++$Num_Lines;
X            }
X            else
X            {
X               $New_Line .= $&;
X            };
X            $Line = $';
X         };
X
X         $Buffer .= "\n" if ($Num_Lines++);
X         $Buffer .= "$Offset$New_Line$Line";
X         $Offset = $Space_Offset if (($Offset) && ($Offset_Once));
X      }
X
X      else
X      {
X         $Buffer .= "\n$Blank_Offset";
X      };
X   };
X
X   return ($Buffer);
X
};
X
1;
SHAR_EOF
chmod 0444 libs/strings1.pl ||
echo 'restore of libs/strings1.pl failed'
Wc_c="`wc -c < 'libs/strings1.pl'`"
test 4687 -eq "$Wc_c" ||
	echo 'libs/strings1.pl: original size 4687, current size' "$Wc_c"
fi
# ============= libs/timespec.pl ==============
if test -f 'libs/timespec.pl' -a X"$1" != X"-c"; then
	echo 'x - skipping libs/timespec.pl (File already exists)'
else
echo 'x - extracting libs/timespec.pl (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'libs/timespec.pl' &&
;# NAME
;#    timespec.pl - convert a pre-defined time specifyer to seconds
;#
;# AUTHOR
;#    Michael S. Muegel (mmuegel@mot.com)
;#
;# RCS INFORMATION
;#    mmuegel
;#    /usr/local/ustart/src/mail-tools/dist/foo/libs/timespec.pl,v 1.1 1993/07/28 08:07:19 mmuegel Exp
X
package timespec;
X
%TIME_SPEC_TO_SECONDS 	= ("s", 1,
X		    	   "m", 60,
X		    	   "h", 60 * 60,
X		    	   "d", 60 * 60 * 24
X		    	   );
X
$VALID_TIME_SPEC_EXPR 	= "[" . join ("", keys (%TIME_SPEC_TO_SECONDS)) . "]";
X
;###############################################################################
;# Time_Spec_To_Seconds
;#
;# Converts a string of the form:
;#
;#    (<number>(s|m|h|d))+
;#
;# to seconds. The second part of the time spec specifies seconds, minutes, 
;# hours, or days, respectfully. The first part is the number of those untis. 
;# There can be any number of such specifiers. As an example, 1h30m means 1 
;# hour and 30 minutes.
;#
;# If the parsing went OK then $Status is 1, $Msg is undefined, and $Seconds
;# is $Time_Spec converted to seconds. If something went wrong then $Status
;# is 0 and $Msg explains what went wrong.
;#
;# Arguments:
;#    $Time_Spec
;#
;# Returns:
;#    $Status, $Msg, $Seconds
;###############################################################################
sub main'Time_Spec_To_Seconds
{
X   $Time_Spec = $_[0];
X
X   $Seconds = 0;
X   while ($Time_Spec =~ /^(\d+)($VALID_TIME_SPEC_EXPR)/)
X   {
X      $Seconds += $1 * $TIME_SPEC_TO_SECONDS {$2};
X      $Time_Spec = $';
X   };
X
X   return (0, "error parsing time spec: $Time_Spec") if ($Time_Spec ne "");
X   return (1, "", $Seconds);
X
};
X
X
1;
SHAR_EOF
chmod 0444 libs/timespec.pl ||
echo 'restore of libs/timespec.pl failed'
Wc_c="`wc -c < 'libs/timespec.pl'`"
test 1609 -eq "$Wc_c" ||
	echo 'libs/timespec.pl: original size 1609, current size' "$Wc_c"
fi
# ============= man/cqueue.1 ==============
if test ! -d 'man'; then
    echo 'x - creating directory man'
    mkdir 'man'
fi
if test -f 'man/cqueue.1' -a X"$1" != X"-c"; then
	echo 'x - skipping man/cqueue.1 (File already exists)'
else
echo 'x - extracting man/cqueue.1 (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'man/cqueue.1' &&
.TH CQUEUE 1L
\"
\" mmuegel
\" /usr/local/ustart/src/mail-tools/dist/foo/man/cqueue.1,v 1.1 1993/07/28 08:08:25 mmuegel Exp
\"
.ds mp \fBcqueue\fR
.de IB
.IP \(bu 2
..
.SH NAME
\*(mp - check sendmail queue for problems
.SH SYNOPSIS
.IP \*(mp 7 
[ \fB-abdms\fR ] [ \fB-q\fR \fIqueue-dir\fI ] [ \fB-t\fR \fItime\fR ] 
[ \fB-u\fR \fIusers\fR ] [ \fB-w\fR \fIwidth\fR ]
.SH DESCRIPTION
Reports on problems in the sendmail queue. With no options this simply
means listing messages that have been in the queue longer than a default
period along with a summary of queue mail by host and status message.
.SH OPTIONS
.IP \fB-a\fR 14
Report on all messages in the queue. This is equivalent to saying \fB-t\fR 0s.
You may like this command so much that you use it as a replacement for
\fBmqueue\fR. For example:
.sp 1
.RS
.RS
\fBalias mqueue cqueue -a\fR
.RE
.RE
.IP \fB-b\fR 14
Also report on bogus queue files. Those are files that

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -