Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8015579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:17:40+00:00 2026-06-04T20:17:40+00:00

In my script i created a file that i want to use as an

  • 0

In my script i created a file that i want to use as an input source for dialog program, in order to populate the menu dialog.

In the file every line contain a number and a menu title.

INPUT=""
rm result
while read LINE
do
        case $LINE in
            '/ >'*|---*|'/ > '*)
                  continue;;
            esac
#       echo "1 $LINE "
                echo -n " 1  \"$LINE\"" >>result
done < tmpfile
#printf "%s " $INPUT
DIALOG  --menu "Latest news " 20 50 30 `cat result`

DIALOG is a function, and this is the source:

DIALOG () {
        dialog --backtitle "$TITLE" "$@"
        return $?
}

Every menu item for dialog need an identifie (in my example is the number) and a label (between double quotes “, if it is more than one word).

The problem is that even if the file content has the correct format:

1 "item number 1" 2 "item number 2" ...

The dialog command doesn’t recognize the \” as a label delimiter, but it consider it as a part of the string, resulting in a messed up menu, where i have a menu voice for every word.

but if i try to copy and pastethe same file content directly into the shell command (not using a script), the menu is showed correctly.

Any idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T20:17:41+00:00Added an answer on June 4, 2026 at 8:17 pm

    You can use an array to keep the results, then use proper quoting to send it to dialog:

    ar=()
    while read n s ; do
        ar+=($n "$s")
    done < result
    dialog  --menu "Latest news " 20 50 30 "${ar[@]}"
    

    You probably do not have to create a temp file at all, you can populate the array right ahead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a file that is created by a script that is run during
im trying to create a script that opens a file and replace every 'hola'
I copied jquery.js to WebContent/js/jquery/jquery.js . Now I want to use that file in
Hi I have a script that creates a file and stores it on the
I'm trying to create a script that takes a .txt file with multiple lines
I have a Python script that reads through a text csv file and creates
I created a file download script in PHP, it works, but web browsers report
I have created a file called untitled1.cpp in dev-cpp with the following script: #include
I have a java program that generates an HTML file. The Java program takes
I'd like to use Javascript to make IE6 download a file. It'll be created

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.