From 5ab78b2f048d000cbd93d678e67678e0e62caaae Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Tue, 26 Nov 2024 16:30:52 +0100 Subject: [PATCH] count installs --- what-s_installed-everywhere.sh | 36 ++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/what-s_installed-everywhere.sh b/what-s_installed-everywhere.sh index ec239c5c..965b3018 100755 --- a/what-s_installed-everywhere.sh +++ b/what-s_installed-everywhere.sh @@ -29,17 +29,41 @@ fi PKG_OK="| x " PKG_KO="| " -echo "| tibou | titplume | tibonom | gwenhael |" -echo "|----------+----------+----------+----------+-------" +counter=0 +echo "| tibou | titplume | tibonom | gwenhael | NB |" +echo "|----------+----------+----------+----------+----+-----" for cat in a ap d l lua n wayland xap y; do cd $cat for p in $(ls -1); do - echo -n $PKGs_tibou | grep -q " $(echo $p | tr -d /) " && echo -n "$PKG_OK" || echo -n "$PKG_KO" - echo -n $PKGs_titplume | grep -q " $(echo $p | tr -d /) " && echo -n "$PKG_OK" || echo -n "$PKG_KO" - echo -n $PKGs_tibonom | grep -q " $(echo $p | tr -d /) " && echo -n "$PKG_OK" || echo -n "$PKG_KO" - echo -n $PKGs_gwenhael | grep -q " $(echo $p | tr -d /) " && echo -n "$PKG_OK" || echo -n "$PKG_KO" + if echo -n $PKGs_tibou | grep -q " $(echo $p | tr -d /) "; then + echo -n "$PKG_OK"; + counter=$((counter + 1)); + else + echo -n "$PKG_KO"; + fi + if echo -n $PKGs_titplume | grep -q " $(echo $p | tr -d /) "; then + echo -n "$PKG_OK"; + counter=$((counter + 1)); + else + echo -n "$PKG_KO"; + fi + if echo -n $PKGs_tibonom | grep -q " $(echo $p | tr -d /) "; then + echo -n "$PKG_OK"; + counter=$((counter + 1)); + else + echo -n "$PKG_KO"; + fi + if echo -n $PKGs_gwenhael | grep -q " $(echo $p | tr -d /) "; then + echo -n "$PKG_OK"; + counter=$((counter + 1)); + else + echo -n "$PKG_KO"; + fi + echo -n "| $counter " echo "| $cat/$p" + + counter=0 done | sort cd .. done