How to echo all values from array in bash
<p>I am making a bash script using dialog. My script make the difference between files in two tar.gz. Each add files are put in an array and each delete files are put in an other array.</p>

<p>All files are add in my two array and when I want echo them it's works</p>

<pre><code>echo ${tabAjout[@]}
echo ${tabSuppr[@]} 
</code></pre>

<p>The output is :</p>

<pre><code>bonjour.txt.gpg test2.txt.gpg test.txt.gpg
hello.txt.gpg
</code></pre>

<p>Now I want add this in msgbox. </p>

<pre><code>function affiche_message(){
    #Personnalisation de la fenêtre
    $DIALOG --title "$1" \
            --msgbox "$2" 20 45
}
</code></pre>

<p>Call function :</p>

<pre><code>affiche_message "Title" "Delete : ${tabSuppr[@]} \n\n Add : ${tabAjout[@]}"
</code></pre>

<p>When I run my script the msgbox contains only the first values of the array. If I change ${tabAjout[@]} by ${#tabAjout[@]} the dialog windows echo that array contains 3 values.</p>