The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
#!/usr/local/bin/perl -w

#
# $Id: yes.abigail,v 1.1 2004/07/23 20:10:22 cwest Exp $
#
# $Log: yes.abigail,v $
# Revision 1.1  2004/07/23 20:10:22  cwest
# initial import
#
# Revision 1.2  1999/02/25 01:20:35  abigail
# Added '--' support.
#
# Revision 1.1  1999/02/25 01:15:03  abigail
# Initial revision
#
#

use strict;

my ($VERSION) = '$Revision: 1.1 $' =~ /([.\d]+)/;

if (@ARGV) {
    if ($ARGV [0] eq '--version') {
        $0 =~ s{.*/}{};
        print "$0 (Perl bin utils) $VERSION\n";
        exit;
    }
    if ($ARGV [0] eq '--help') {
        $0 =~ s{.*/}{};
        print <<EOF;
Usage: $0 [OPTION] [STRING [STRING [STRING ... ]]]

Repeatedly print its arguments, or "y".

Options:
       --version:  Print version number, then exit.
       --help:     Print usage, then exit.
       --:         Stop parsing options.
EOF
        exit;
    }
    if ($ARGV [0] eq '--') {
        shift;
        unshift @ARGV, "y" unless @ARGV;
    }
    $_ = "@ARGV\n";
}
else {$_ = "y\n"}

print while 1;

__END__

=pod

=head1 NAME

yes - print out a string till doomsday.

=head1 SYNOPSIS

yes [option] [strings]

=head1 DESCRIPTION

I<yes> repeatedly prints out its arguments on standard output, untill killed.
If no strings are given, I<y> is printed.

=head2 OPTIONS

I<yes> accepts the following options:

=over 4

=item --help

Print out a short help message, then exit.

=item --version

Print out its version number, then exit.

=item --

Stop parsing for options. Useful if you want to print out I<--help>
or I<--version>. Use I<yes -- --> to print out I<-->.

=back

=head1 ENVIRONMENT

The working of I<yes> is not influenced by any environment variables.

=head1 BUGS

I<yes> has no known bugs.

=head1 REVISION HISTORY

    $Log: yes.abigail,v $
    Revision 1.1  2004/07/23 20:10:22  cwest
    initial import

    Revision 1.2  1999/02/25 01:20:35  abigail
    Added '--' support.

    Revision 1.1  1999/02/25 01:15:03  abigail
    Initial revision

=head1 AUTHOR

The Perl implementation of I<yes> was written by Abigail, I<abigail@fnx.com>.

=head1 COPYRIGHT and LICENSE

This program is free and open software. You may use, modify, distribute
and sell this program (and any modified variants) in any way you wish,
provided you do not restrict others to do the same.

=cut