Codice: Seleziona tutto
#! /bin/bash
declare -a first
i=0
wmctrl -l| while read line
do
echo $i $line
first[$i]=$line
(( i=i+1 ))
done
echo "la array contiene " ${#first[@]} " righe"Codice: Seleziona tutto
lubuntu@lubuntu-VirtualBox:~/MyScripts$ bash clear_desktop.sh
0 0x01a00021 -1 lubuntu-VirtualBox panel
1 0x01600001 -1 lubuntu-VirtualBox Conky (lubuntu-VirtualBox)
2 0x01a0002f -1 lubuntu-VirtualBox panel
3 0x01a00033 -1 lubuntu-VirtualBox panel
4 0x01c00008 -1 lubuntu-VirtualBox pcmanfm
5 0x02a00004 0 lubuntu-VirtualBox lubuntu@lubuntu-VirtualBox: ~/MyScripts
6 0x01c003ba 0 lubuntu-VirtualBox MyScripts
7 0x02400003 0 lubuntu-VirtualBox clear_desktop.sh
8 0x02800003 0 lubuntu-VirtualBox logfile
la array contiene 0 righe

