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
Post a Comment