Cant separate variables


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Cant separate variables
# 1  
Old 07-12-2009
Cant separate variables

Hey guys, new problem....im not being able to seperate variables.

the code runs like this...

OPTIONS=$(awk '{print $2}' /etc/fstab}

a=$(zenity --list --text "Mount points selection" --radiolist --column "choice" --column "mountpt" FALSE $OPTIONS); echo $a

Note: the result i get is that zenity displays all the mountpoints as a single option in zenity. Not like each mount point having one radio button each. Help please...

---------- Post updated at 07:50 PM ---------- Previous update was at 04:36 PM ----------

Hey guys, anyone care to give me a hand ?
dplate07
# 2  
Old 07-12-2009
Code:
OPTIONS=$(awk '{print $2}' /etc/fstab}

set -- $OPTIONS

while [[ $1 ]]
do
    a=$(zenity --list --text "Mount points selection" --radiolist --column "choice" --column "mountpt" FALSE $1); echo $a
    shift
done

# 3  
Old 07-12-2009
Also
Code:
for i in $OPTIONS; do
  zenity --list --text "Mount points selection" --radiolist --column "choice" --column "mountpt" FALSE $i
done


Last edited by Sapfeer; 07-12-2009 at 12:27 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Assistance to connect to servers via ssh once and collect various commands into separate variables

Hello, We use as bash script to connect to servers listed in an .csv file to issue commands against these servers and retrieve data to be saved in a .csv file. The data we want to collect is saved in variables. We issue an ssh command for each variable we want to capture. I'm thinking this is... (9 Replies)
Discussion started by: greavette
9 Replies

2. UNIX for Dummies Questions & Answers

How to pass variables into anothother variables?

Below are three variables, which I want to pass into variable RESULT1 username1=userid poihostname1=dellsys.com port1=8080 How can I pass these variables into below code... RESULT1=$((ssh -n username1@poihostname1 time /usr/sfw/bin/wget --user=sam --password=123 -O /dev/null -q... (4 Replies)
Discussion started by: manohar2013
4 Replies

3. Shell Programming and Scripting

Passing awk variables to bash variables

Trying to do so echo "111:222:333" |awk -F: '{system("export TESTO=" $2)}'But it doesn't work (2 Replies)
Discussion started by: urello
2 Replies

4. Shell Programming and Scripting

BASH arrays and variables of variables in C++

Sometimes it is handy to protect long scripts in C++. The following syntax works fine for simple commands: #define SHELLSCRIPT1 "\ #/bin/bash \n\ echo \"hello\" \n\ " int main () { cout <<system(SHELLSCRIPT1); return 0; } Unfortunately for there are problems for: 1d arrays:... (10 Replies)
Discussion started by: frad
10 Replies

5. Shell Programming and Scripting

Running a script with multiple variables like 25 variables.

Hi All, i have a requirement where i have to run a script with at least 25 arguements and position of arguements can also change. the unapropriate way is like below. can we achieve this in more good and precise way?? #!/bin/ksh ##script is sample.ksh age=$1 gender=$2 class=$3 . . .... (3 Replies)
Discussion started by: Lakshman_Gupta
3 Replies

6. Shell Programming and Scripting

Want to separate one string

Hello friends. I have on file with following data Jhon Status: Form successfully submitted Maria Status:Form successfully submitted Shyne Status: Form submission pending. Liken Status:Form successfully submitted David Status:Form successfully submitted Rich Status: Form... (7 Replies)
Discussion started by: Nakul_sh
7 Replies

7. Shell Programming and Scripting

awk: Print fields between two delimiters on separate lines and send to variables

I have email headers that look like the following. In the end I would like to accomplish sending each email address to its own variable, such as: user1@domain.com='user1@domain.com' user2@domain.com='user2@domain.com' user3@domain.com='user3@domain.com' etc... I know the sed to get rid of... (11 Replies)
Discussion started by: tay9000
11 Replies

8. Shell Programming and Scripting

Read 1-line file and separate into multiple variables

I have one line files with 17 records separated by a semi-colon. I need to create a variable from each record, which I can do via a separate awk for each one, but I know there has to be a better way. Along with pulling out the variable, I need to convert some url coding like a + to a space, etc.... (4 Replies)
Discussion started by: numele
4 Replies

9. Shell Programming and Scripting

Bash script to read a hostname and separate into variables

Hi All, I'm trying to concoct a bash script to use with a Puppet Implementation that will accept a hostname and break it down into variables. For example, my hostnames look like this --> machinename-group-building.example.com I'm looking for a way in the script to read until the first... (4 Replies)
Discussion started by: glarizza
4 Replies

10. Programming

How to convert byteArray variables to HexaString variables for Linux?

Hello everybody, I am having problem in converting byte array variables to Hexa String variables for Linux. I have done, converting byte array variables to Hexa String variables for Windows but same function doesn't work for linux. Is there any difference in OS ? The code for Windows is given... (2 Replies)
Discussion started by: ritesh_163
2 Replies
Login or Register to Ask a Question