1######################################################################## 2# # 3# This software is part of the ast package # 4# Copyright (c) 1989-2012 AT&T Intellectual Property # 5# and is licensed under the # 6# Eclipse Public License, Version 1.0 # 7# by AT&T Intellectual Property # 8# # 9# A copy of the License is available at # 10# http://www.eclipse.org/org/documents/epl-v10.html # 11# (with md5 checksum b35adb5213ca9657e911e9befb180842) # 12# # 13# Information and Software Systems Research # 14# AT&T Research # 15# Florham Park NJ # 16# # 17# Glenn Fowler <glenn.s.fowler@gmail.com> # 18# # 19######################################################################## 20# 21# yes.sh 22# Written by David Korn 23# AT&T Labs 24# Wed May 16 09:23:23 EDT 2007 25# 26case $(getopts '[-]' opt "--???man" 2>&1) in 27version=[0-9]*) 28 usage=$'[-?@(#)yes (AT&T Labs Research) 2012-06-06\n] 29 '$USAGE_LICENSE$' 30 [+NAME?yes - repeatedly out a string until killed] 31 [+DESCRIPTION?\byes\b repeatedly writes \astring\a to standard 32 output, followed by a \anewline\a character, until it 33 is terminated. If \astring\a is omitted then 34 then \by\b is used.] 35 36 [string] 37 38 [+EXIT STATUS?]{ 39 [+0?Success.] 40 [+>0?An error occurred.] 41 } 42 ' 43 ;; 44*) 45 usage='' 46 ;; 47esac 48 49while getopts "$usage" var 50do case $var in 51 esac 52done 53shift $((OPTIND-1)) 54string=${@-y} 55case $KSH_VERSION in 56'') echo=echo ;; 57*) echo="print -r --" ;; 58esac 59while : 60do $echo "$string" 61done 62