What i'm trying to do, is to list all my aliases kinda like this, when i call functions
in my bash terminal
$ functions
functions -> List all functions
fs -> Determine size of a file or total size of a directory
That ends up happening, is it list every word, so the output looks like this
functions
->
List
all
...
How do iterate get an array like
['functions -> List all functions', 'fs -> Determine size of a file or total size of a directory]
that I can iterate over?
My implementation is listed below
declare -a dotfilesFunctionAlias=()
function appendFunction(){
dotfilesFunctionAlias+=( "$1->$2" )
}
appendFunction "functions" "List all functions";
function functions(){
for func in ${dotfilesFunctionAlias[@]}; do
echo $func;
done;
}