dialog --menu selected option
My script is:
开发者_如何学JAVAdialog --title 'Example' --menu 'Select:' 0 0 0 1 'ABC' 2 'DEF' 3 'GHI'
I would like that option 2 was selected by default (over). Its possible?
Try:
dialog --title 'Example' --default-item '2' --menu 'Select:' 0 0 0 1 'ABC' 2 'DEF' 3 'GHI'
dialog --title "Example" --default-item '2' --menu "Select:" 25 25 3 1 "ABC" 2 "DEF" 3 "GHI"
use of ["] for strings is most recommended --default-item is common option provided into dialog utilities for menu box or forms. This will keep selection on '2' option.
精彩评论