bash - linux dialog --checklist error -


i working on following linux dialog box. not able understand it's behavior. works correctly i.e. correctly displays 3 checkboxes.

#!/bin/sh  dialog --backtitle "test" \ --title "checkbox test " \ --checklist "choose following"  0 0 0 \ apple "the apple green" on \ mango "the mango golden" on \ pappaya "the pappaya brown" on \ 2> /tmp/optional.out optional=`cat /tmp/optional.out | \     sed -e "s/\"//g" -e "s/ /|/g" -e "s/|$//"`     echo 'optional :'$optional 

after execution following output as. optional :apple|mango|pappaya

however want show user 2 options. made following changes.

#!/bin/sh  dialog --backtitle "test" \ --title "checkbox test " \ --checklist "choose following"  0 0 0 \ apple "the apple green" on \ mango "the mango golden" on \ #pappaya "the pappaya brown" on \ 2> /tmp/optional.out optional=`cat /tmp/optional.out | \     sed -e "s/\"//g" -e "s/ /|/g" -e "s/|$//"`     echo 'optional :'$optional 

but after doing no output i.e. optional :. why that? how can make work.

i'm thinking did comment , broke line. (it happens many times me)

you may try this:

#!/bin/sh  dialog --backtitle "test" \ --title "checkbox test " \ --checklist "choose following"  0 0 0 \ apple "the apple green" on \ mango "the mango golden" on \ 2> /var/tmp/optional.out optional=`cat /var/tmp/optional.out | \     sed -e "s/\"//g" -e "s/ /|/g" -e "s/|$//"`     echo 'optional :'$optional 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -