From 4e6c984c9198aef59d1ae59be1303ab35149e017 Mon Sep 17 00:00:00 2001 From: tenzi Date: Fri, 28 Nov 2025 16:59:23 +0100 Subject: [PATCH] add arrays --- grabber.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/grabber.sh b/grabber.sh index 4924753..2b93cc3 100755 --- a/grabber.sh +++ b/grabber.sh @@ -37,7 +37,14 @@ apt list --installed 2> >(tee -a $ERROR_LOG) >$DIR/apt-installed.cmd \ && echo "[OK]: Fichier apt-installed.cmd généré" |tee -a $SUCCESS_LOG \ || echo "[ECHEC]: Erreur à la génération de apt-installed.cmd" |tee -a $ERROR_LOG +# Commande array +tee -a $SUCCESS_LOG $ERROR_LOG <$DIR/status.log + +for disk in ${!PARTITIONS_BY_DISK[@]}; do + echo "PARTS_$disk=$(printf '%s ' ${PARTITIONS_BY_DISK[$disk]})" >>$DIR/status.log +done + +treat_file() { + echo "Les arguments: $@" + echo "Argument 1: $1" + cat $2 >>$DIR/$1 + +} + +treat_file sources_list.file /etc/apt/sources.list + +for file in ${!FILES[@]}; do + treat_file $file ${FILES[$file]} +done + #cat /etc/passwd > $DIR/passwd.file #cat /etc/group > $DIR/group.file #lspci -nn > $DIR/lspci.cmd