PDA

View Full Version : [SOLVED] "ls | glade-3" not working



J V
October 28th, 2009, 11:08 PM
If I'm correct the following script should open up all of my glade files for me... it works if I type them in by hand...

ls | glade-3

geirha
October 28th, 2009, 11:22 PM
In the glade-3 man-page (http://manpages.ubuntu.com/manpages/jaunty/en/man1/glade-3.1.html) there's no mention of it accepting a filelist from standard input. Secondly it only accepts one file as argument according to the synopsis, so you'll probably have to run a loop to start it once for each file.

for file in *.glade; do
glade-3 "$file"
done


If it doesn't automatically background itself (i.e. stops at the first invocation of glade-3), you can add an & at the end.


for file in *.glade; do
glade-3 "$file" &
done


Oh and you can do that all on one line, which is handy for interactive shells


for file in *.glade; do glade-3 "$file"; done
# or
for file in *.glade; do glade-3 "$file" & done

J V
October 28th, 2009, 11:30 PM
Well using this Glade opens multiple files correctly... I don't know why the pipe won't work...

glade-3 file1.glade file2.gladeAnd when I run the second one glade pops open a ton of seperate windows, which is no good either...

for file in *.glade; do glade-3 "$file" & done

geirha
October 28th, 2009, 11:36 PM
I see, the man-page doesn't match the actual command then.

glade-3 *.glade

J V
October 28th, 2009, 11:40 PM
Wow, so simple, and it works! Thanks :P

[SOLVED]