Please can somebody put me out of my misery! I'm trying to display the contents of an array created from a dynamic text file in a checklist and as far as I can tell I have tried all the recommended solutions to display the list accurately, but none seemed to work correctly. Some of the information going missing!
My test text file contains the following four lines of information.
sda disk 7.5G STORE_N_GO
sdb disk 894.3G NV-C01
mmcblk0 disk 29.7G
nvme0n1 disk 953.9G Sabrent
Having read and researched lots of examples of how to display this information in a checklist, none of them seem to be working.
If I run the code:
#!/bin/bash
IFS=$'\n' myArray=($(cat /home/eviget/eviget_scripts/devinfo3))
devsToMnt=$(for i in $(seq ${#myArray[@]}); do echo "${myArray[$i-1]}"; done | yad --list --center --height="400" --checklist --column="Select" --column="Device to mount:" --print-column="2" --multiple --separator=" ")
exit 0
or this from the terminal I get the same out put with the first and third records missing seethe images below, and If I print the array to the terminal all the records are displayed and I'm at a loss as to know why. Any help would be much appreciated.
Chris