#!/bin/bash
 
# triangle.sh - draws a triangle
# made as a "homework" for school's sysadmin course
 
if [ "$1" == "" ]
then
	echo "Input size"
else
	S=$[$1*1]
	for i in `seq $S`
	do
			LINE=""
			for a in `seq $[$S*2+1]`
			do
				if [ $a -gt $[$[$S+1] - $i] ]
				then
					if [ $a -lt $[$[$S+1] + $i] ]
					then
						LINE="$LINE#"
					fi
				else
				LINE="$LINE "			
			fi
		done
		echo "$LINE"
	done
fi