LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 01-20-2004, 04:54 PM   #1
Paasan
LQ Newbie
 
Registered: Sep 2002
Location: Norway
Posts: 9

Rep: Reputation: 0
Bash Script: Problem running variable command containing ""


I need to run the following command inside a bash script:

Code:
dialog --backtitle "Back Title" --title "Title" --menu "" 40 40 10 \ 
"1" "one two three four" \ 
"2" "five six seven eight" \
2> temp.file
Where "1" "one two three four" "2" "five six seven eight" are diffrent variables. And it can be a lot more variables, since its going to be read from a seperate file which contains more or less rules for iptables

But when i run it it will be ran as:
Code:
dialog --backtitle "Back Title" --title "Title" --menu "" 40 40 10 \ 
"1" "one" \
"two" "three" \
"four" "2" \
"five" "six" \
"seven" "eight" \
2> temp.file
I've tryed everything possible i could think of like:
Code:
var1="1"
var2="one two three four"
Code:
var="$var $var1 $var2"
or

Code:
var="$var \"${var1}\" \"${var2}\""
or

Code:
var=$(echo $var \"$var1\" \"$var2\")
and a lot more.

This is a little hard to explain, but you can download the script from http://62.73.217.42/paasan.tar.gz
It will extract itself to a directory called "paasan" containing the script and a modified version of dialog.

Really hope someone can help
Thanks in advance
 
Old 01-21-2004, 12:16 AM   #2
crabboy
Moderator
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 120Reputation: 120
Ok, I've downloaded the script, but I still do not understand what the problem is. It looks like the command generated is exactly as you posted it in the first code block. Post an example of what you are seeing and what you'd expect to see.
 
Old 01-21-2004, 02:45 AM   #3
Paasan
LQ Newbie
 
Registered: Sep 2002
Location: Norway
Posts: 9

Original Poster
Rep: Reputation: 0
This is what it looks like:
http://62.73.217.42/2.jpg

This is what i want it to look like:
http://62.73.217.42/1.jpg
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bash script: using "select" to show multi-word options? (like "option 1"/"o zidane_tribal Programming 6 03-21-2013 11:35 AM
Shell Script: Find "Word" Run "Command" granatica Linux - Software 5 07-25-2007 08:42 AM
How to write a bash script to replace all "KH" to "K" in file ABC??? cqmyg5 Slackware 4 07-24-2007 10:00 AM
bash Problem with "sed" command blubbfish Linux - Newbie 3 06-01-2004 11:14 AM
bash script problem with "else" evilchild Programming 9 11-16-2003 09:57 PM


All times are GMT -5. The time now is 10:36 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration