#!/bin/bash SEP="," echo "$1" $SEP "eLOC" $SEP "Description" $SEP "Path" function qml_eloc { eLOC=$(qmlmin "$1" | sed -e 's/;/\n/g;s/}/\n}\n/g;s/\n\n/\n/g;s/\n\n\n/\n/g' | wc -l) echo "$eLOC" } if [[ -n "$1" && -f "./$1" ]]; then echo "$1:" $(qml_eloc "$1") exit 0 fi if [[ -n "$1" && -d "./$1" ]]; then QML_FILES=($(find "./$1" -name *.qml | sort)) for qml_file in "${QML_FILES[@]}"; do # echo "$( basename $qml_file)" " : " $(qml_eloc "$qml_file") " : " "$( dirname $qml_file)" echo $(basename "$qml_file") $SEP $(qml_eloc "$qml_file") $SEP $SEP $(dirname "$qml_file") done exit 0 fi echo "Please give the qml file name or qml files location" exit 1