########################################################################1# #2# This software is part of the ast package #3# Copyright (c) 1989-2012 AT&T Intellectual Property #4# and is licensed under the #5# Eclipse Public License, Version 1.0 #6# by AT&T Intellectual Property #7# #8# A copy of the License is available at #9# http://www.eclipse.org/org/documents/epl-v10.html #10# (with md5 checksum b35adb5213ca9657e911e9befb180842) #11# #12# Information and Software Systems Research #13# AT&T Research #14# Florham Park NJ #15# #16# Glenn Fowler <[email protected]> #17# #18########################################################################19#20# yes.sh21# Written by David Korn22# AT&T Labs23# Wed May 16 09:23:23 EDT 200724#25case $(getopts '[-]' opt "--???man" 2>&1) in26version=[0-9]*)27usage=$'[-?@(#)yes (AT&T Labs Research) 2012-06-06\n]28'$USAGE_LICENSE$'29[+NAME?yes - repeatedly out a string until killed]30[+DESCRIPTION?\byes\b repeatedly writes \astring\a to standard31output, followed by a \anewline\a character, until it32is terminated. If \astring\a is omitted then33then \by\b is used.]3435[string]3637[+EXIT STATUS?]{38[+0?Success.]39[+>0?An error occurred.]40}41'42;;43*)44usage=''45;;46esac4748while getopts "$usage" var49do case $var in50esac51done52shift $((OPTIND-1))53string=${@-y}54case $KSH_VERSION in55'') echo=echo ;;56*) echo="print -r --" ;;57esac58while :59do $echo "$string"60done616263