[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [live-build] "E: Unable to find a source package for syslinux,grub-efi"



On 2020-03-11 03:52, jnqnfe@gmail.com wrote:
On Tue, 2020-03-10 at 15:38 +0000, jnqnfe@gmail.com wrote:

```
LB_BOOTLOADERS="syslinux,grub-efi"
echo "${LB_BOOTLOADERS}" | while IFS="," read -r BOOTLOADER; do
	echo "bootloader: ${BOOTLOADER}"
done
```
this code always fails to split the comma separated string...
> i don't know why it will not work...

This is because only one variable name is being provided for read to put the words in, so they all get pushed into BOOTLOADER, even though the IFS is a comma. Try adding a second var name to see:
LB_BOOTLOADERS="syslinux,grub-efi"
echo "${LB_BOOTLOADERS}" | while IFS="," read -r BOOTLOADER1 BOOTLOADER2; do
 	echo "bootloader: ${BOOTLOADER1}"
        echo "bootloader: ${BOOTLOADER2}"
done
But that's not what you want. Since LiveBuild's scripts are POSIX sh not bash, arrays are not available unfortunately.

--
John


Reply to: