Skip to content
Snippets Groups Projects
recursion 417 B
Newer Older
  • Learn to ignore specific revisions
  • Easy Build's avatar
    Easy Build committed
    recursion()
    {
    
        local LIST="$(ml show "$1" 2>&1 | grep -E "load\(\"[[:alnum:]/\._-]*\"\)" | cut -d '"' -f2 | sort)"
    
    Easy Build's avatar
    Easy Build committed
        if [[ -z "$LIST" ]];then
    	OUT="$1 $OUT"
    	echo -n "."
            return 0
        fi
    
        for MODULE in "$LIST"; do
            local DUP="$(echo -e "$OUT" | grep "$MODULE")"
    
    Easy Build's avatar
    Easy Build committed
            if [[ -z "$DUP" ]];then
    
                recursion "$MODULE"
    
    Easy Build's avatar
    Easy Build committed
            fi
        done
        OUT="$1 $OUT"
        echo -n "."
        return 0
    }