#!/bin/bash # read n; # awk -v n=$n 'BEGIN{ # for(i = 1; i <= n; ++i){ # row[i] = ""; # for(j = 1; j <= n-i; ++j){ # row[i] = row[i] " "; # } # for(k = 1; k <= i; ++k){ # row[i] = row[i] "* "; # } # print row[i]; # } # }' read n; awk -v n=$n 'BEGIN{ for(i = 1; i <= n; ++i){ row[i] = ""; for(j = n-i; j >= 1; --j){ row[i] = row[i] " "; } for(k = 1; k <= i; ++k){ row[i] = row[i] "* "; } print row[i]; } }'