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

Re: Whiptail question



On Sun, 8 Feb 1998, George Bonser wrote:

> I am not sure if this is the best place to ask this but I am having a
> little trouble with whiptail.
> 
> This does not work:
> 
> #! /bin/bash
> 
> BOXTITLE="A Title"
> BACKTITLE="Screen Title"
> 
> if (whiptail --backtitle $BACKTITLE --title $BOXTITLE --yesno "Yes or No"
> 7 40)
> then
> 	echo -e "\nYes\n"
> else
> 	echo -e "\nNo\n"
> fi
> 
> If I hardcode the titles into the string like this ... --backtitle
> "Screen Title" -- title "A Title" ... it works.
>
> This seems to be to be a serious waste of space and programming effort
> particularly when you have titles that may remain the same through
> several boxes.

try putting quotes (") around the variable references like so:

whiptail --backtitle "$BACKTITLE" --title "$BOXTITLE" --yesno "Yes or No" 7 40

the quotes will serve to escape the spaces in the variables, so whiptail
sees the whole string as one argument.  it's got nothing to do with
whiptail, actually....it's just standard sh usage.

craig




--
craig sanders


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: