0

There's next code:

TITLE="Some value with spaces"
DIALOG="${DIALOG=dialog} --clear --no-tags --tab-correct --backtitle $TITLE "
...
$DIALOG --title "Some title --menu "Menu" 15 60 5 "1" "menu1" "2" "menu2"
 ...

When TITLE contains string with no spaces DIALOG works OK. With spaces - no correct substitution is done.

Tried to use variants like (with no luck):

$TITLE
"$TITLE"
\"$TITLE\"
${TITLE}
"${TITLE}"
\"${TITLE}\"
TITLE='Some value with spaces'
TITLE="Some\ value\ with\ spaces"

How has correct substitution to be done?

Someone
  • 303

1 Answers1

0

This code works OK:

TITLE="Some value with spaces"
DIALOG="${DIALOG=dialog}
OPTS=(--clear --no-tags --tab-correct --backtitle "$TITLE")
...
$DIALOG "${OPTS[@]}" --title "Some title" --menu "Menu" 15 60 5 "1" "menu1" "2" "menu2"
...

Thanks to ilkkachu

Someone
  • 303