Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
46 lines (45 sloc) 928 Bytes
#!/bin/bash
## square-matrix
## - generates square matrices
## version 0.0.1 - initial
##################################################
square-matrix-help() {
{
cat << EOF
square-matrix
1 - order
EXAMPLES
> square-matrix 1
1
> square-matrix 2
1 2
3 4
> square-matrix 3
1 2 3
4 5 6
7 8 9
EOF
}
}
square-matrix() { { local -i order ; order=${1} ; }
test "${order}" || { ${FUNCNAME}-help ; return ; }
test ${order} -gt 0 || { ${FUNCNAME}-help ; return ; }
_() {
seq $(( ${1} ** 2 )) | xargs -n ${1}
}
_ ${order}
}
##################################################
if [ ! ]
then
true
else
exit 1 # wrong args
fi
##################################################
square-matrix ${@}
##################################################
## generated by create-stub2.sh v0.1.2
## on Wed, 29 May 2019 13:44:06 +0900
## see <https://github.com/temptemp3/sh2>
##################################################
You can’t perform that action at this time.