Sample Header Ad - 728x90

Problem with yad and variable's spaces its arguments

1 vote
0 answers
828 views
My code works with:
binariesPathList="FALSE 'inkscape'
TRUE '/home/jeanfar/Downloads/binary-portable/inkscape/Inkscape-1.0-4035a4f-x86_64.AppImage'
FALSE '/home/jeanfar/Downloads/binary-portable/inkscape/Inkscape-f54ab5f-x86_64.AppImage'
FALSE '/home/jeanfar/git-clones/inkscape-0.92.5/build/install_dir/bin/inkscape'
FALSE '/home/jeanfar/git-clones/inkscape/build/install_dir/bin/inkscape'"

# This is to demonstrate how YAD will receive it. 
echo $binariesPathList

answer=$(yad \
    --list \
    --radiolist \
        --column="Pick" \
        --column="Application" \
        --column="Application Path" \
        $binariesPathList \
)
If you run that last code (Ignore buttons): enter image description here But fails with the exact same configuration, but three columns. If you run it, you will note that even with the same ' sign, it split by spaces.
binariesPathList="FALSE 'System Default Installation' 'inkscape'
TRUE '1.0 AppImage' '/home/jeanfar/Downloads/binary-portable/inkscape/Inkscape-1.0-4035a4f-x86_64.AppImage'
FALSE '1.1-dev Appimage' '/home/jeanfar/Downloads/binary-portable/inkscape/Inkscape-f54ab5f-x86_64.AppImage'
FALSE '0.92.5 Build' '/home/jeanfar/git-clones/inkscape-0.92.5/build/install_dir/bin/inkscape'
FALSE 'Master Build' '/home/jeanfar/git-clones/inkscape/build/install_dir/bin/inkscape'"

# This is to demonstrate how YAD will receive it. 
echo $binariesPathList

answer=$(yad \
    --list \
    --radiolist \
        --column="Pick" \
        --column="Application" \
        --column="Application Path" \
        $binariesPathList \
)
If you run that last code (Ignore buttons): enter image description here The really strange thing here is that you can put the parameters directly where the variable should be, and it will work even better than first, and even with those spaces. It's exactly as a copy-paste of the echo, but if you replace the variable with $(echo $binariesPathList) it will be the same result.
answer=$(yad \
    --list \
    --radiolist \
        --column="Pick" \
        --column="Application" \
        --column="Application Path" \
        FALSE 'System Default Installation' 'inkscape' FALSE '1.0 AppImage' '/home/jeanfar/Downloads/binary-portable/inkscape/Inkscape-1.0-4035a4f-x86_64.AppImage' FALSE '1.1-dev Appimage' '/home/jeanfar/Downloads/binary-portable/inkscape/Inkscape-f54ab5f-x86_64.AppImage' FALSE '0.92.5 Build' '/home/jeanfar/git-clones/inkscape-0.92.5/build/install_dir/bin/inkscape' FALSE 'Master Build' '/home/jeanfar/git-clones/inkscape/build/install_dir/bin/inkscape' \
)
If you run that last code: enter image description here
Asked by DATALOT (459 rep)
Jun 21, 2020, 08:00 AM
Last activity: Jun 21, 2020, 08:17 AM