# example from page 276
#
#	SHELL VERSION OF CAT
#
alias open=exec				# open is more descriptive
alias duplicate=exec			# duplicate is more descriptive
set -o noglob				# file expansion not needed
[[ -z $1 ]] && set -- -			# set $1 to - if no arguments
for	i				# go through list of files
do	if	[[ $i != - ]]		# - means standard output
	then	open 3< $i
	else	duplicate 3<&0		# use standard input
	fi
	IFS=
	while	read -u3 -r line	# read in a line
	do	print -r -- "$line"	# print out the line
	done
done
exec 3<&-				# close file
