You are not logged in.

Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Sunday, June 24th 2007, 9:50pm

Kdialog scripting

I've used kdialog in the past in bash scripts but this one just will not work. Anyone care to enlighten me on why not?

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
pname=urlview #this will be replaced by a text input box for package to search for
 slapt-get --search ${pname} > temp

 let n=4
 let pn=0

 for f in `cat temp`
     do
         let n=$n+1
         if  [[ $n == 5 ]]; then
             let pn=$pn+1
             let n=1
             pkg[$pn]=$f
             echo ${pn} ${pkg[${pn}]}
         fi
     done

 let n=0

 IFS=$'\n'
 for f in `cat temp`
     do
         let n=$n+1
         line[$n]=$f
         echo $n ${line[${n}]}
     done


 for (( f=1; f<=$pn; f++ ))
     do
         RESULTS+='"'${pkg[${f}]}'"'" "'"'${line[${f}]}'"'" "off" "
     done

 echo kdialog --radiolist "Search Results" ${RESULTS}
 DISPLAY=":0.0" kdialog --radiolist "Search Results" ${RESULTS}


Basically everything works except the last kdialog. If I copy the echoed results to command line it does work, just not from within the script and there are no error messages etc.

This post has been edited 1 times, last edit by "Slackhead" (Jun 24th 2007, 10:53pm)