1

I want to open all the images in a small directory containing a small number of arbitrary, each image in its own window that has rotate and zoom controls.

I have tried eog,eom,imagemagick,gimp,shotwell... with <app> *.jpg& with no satisfactory results. Usually the application opens only one window. Eye of Gnome/MATE offer --new-instance but this does not provide multiple instances.

I am trying now this :

 for f in $(ls *jpg);do open $f;done;

But this stops and waits after the first open.

I try

 for f in $(ls *jpg);do open $f&;done;

But this is an error

 bash: syntax error near unexpected token `;'

How can I do this?

I have a workaround :

ls *jpg > ims

and then edit ims to produce

eom -n 20200109_144447.jpg&
eom -n 20200109_144804.jpg&
eom -n 20200109_150828.jpg&
eom -n 20200109_150845.jpg&
eom -n 20200109_150853.jpg&

and then issue :

 bash ims

This gets me what I'm looking for, but I'd like a one step solution.

UPDATE:

steeldriver points to the error in my command. This works:

 for f in *jpg;do eom -n $f & done;

Note the removal of the expansion $() and of the second semicolon in the command.

Stephen Boston
  • 2,178
  • 4
  • 32
  • 55
  • https://unix.stackexchange.com/questions/167326/using-semicolon-to-separate-a-background-job-from-the-following-one – steeldriver Jan 10 '20 at 01:34
  • @steeldriver Perhaps I'm a bit thick. I don't see how any of these address my problem. Yes there are various strategies of opening files in background and spawning and so on, but none of these help with what I'm trying to do. I'll try to clarify in my question. – Stephen Boston Jan 10 '20 at 03:17
  • 1
    What is your OS (I'm guessing OSX, based on the open command)? for mine (Ubuntu) for f in *.jpg; do eog "$f" & done seems to work. The error message is because you used both & and ; – steeldriver Jan 10 '20 at 03:25
  • @steeldriver I was using open as a placeholder. I'm on Ubuntu 19.10 MATE. But ah! Thank you for the tip on the error in using & and ;. Works perfectly as you say. Just what I'm looking for. If you paste it into an answer I'll give it the marks. – Stephen Boston Jan 10 '20 at 03:29

0 Answers0