a script with a file chooser tiny bit of help needed

Soldato
Joined
29 Oct 2005
Posts
3,298
hi,

i am trying to make a script that allows you to choose a file then runs another script with this file as a parameter.

Code:
#!/bin/bash

file= zenity --file-selection

cd ~/rs/
./download.sh $file 

exit

this is my script so far but the script doesn't run with the file.

if i replace $file with the filename it runs fine.

any help is appreciated - including alternative methods which inlcude me having a dialog so i can choose a file.

thanks

daven
 
Hmmm...Get this working yet?

Just looking at it quickly, bash doesn't like having spaces after or before the =

So it should be:

Code:
file=zenity
 
Code:
#!/bin/bash

echo 'Enter the filename:'
read filename

cd ~/rs/
./download.sh $filename

exit

Will let you choose a filename and then run the download script with it.
 
hi thanks for the help, what was missing on my initial code was ` ` around the zenity -- file-chooser
and " " around $file

also the space between the = was a problem too

thanks

daven
 
Last edited:
Back
Top Bottom