Re: Viewing multiple .png files simultaneously



On Sep 19, 10:19 am, "Chris F.A. Johnson" <cfajohn...@xxxxxxxxx>
wrote:
On 2007-09-19, Josef Moellers wrote:



Chris F.A. Johnson wrote:
On 2007-09-19, philbo30 wrote:
...

ImageMagick is just the tool I was looking for; it works great. The
only additional thing I would like to do is specify the amount of time
that the image displays. As an example, I want it to display for 60
seconds. I didn't see that capability associated with the "display"
application, but then again I didn't look that much either. Ideas?

display ... &
sleep 5
kill "$!"

<pedantic>
make that
display ... &
sleep 60
kill $!
</pedantic>

What if IFS is not the default? E.g.:

$ (> IFS=1234567890
sleep 20 &
sleep 2
kill $!
)

bash: kill: `': not a pid or valid job spec
bash: kill: `': not a pid or valid job spec
bash: kill: `': not a pid or valid job spec
bash: kill: `': not a pid or valid job spec
$

But:

$ (> IFS=1234567890
sleep 20 &
sleep 2
kill $!
)

$

In this case the quotes are needed; in other cases it doesn't hurt
to have them.

--
Chris F.A. Johnson, author | <http://cfaj.freeshell.org>
Shell Scripting Recipes: | My code in this post, if any,
A Problem-Solution Approach | is released under the
2005, Apress | GNU General Public Licence

So here's what I have currently using a Linux system() call in a C
app:

system("display array.png &");
system("sleep 5");
system("kill $!");

Clearly there is a problem with my kill syntax since the display never
ends until I manually kill it, at which time I see:

"kill: usage: kill [-s sigspec | -n ...........]"

It seems like I need something like this:

system("kill "$!""); //clearly doesn't work

So, last question, what is the syntax for quotes within quotes? I am
on GNU bash version 2.05a.0(1) i686-pc-linux-gnu [Red Hat 7.3, gcc
2.96]

In advance, thanx for the help. -pb30

.



Relevant Pages

  • Re: Periodic Fedora 9 system hangs with jumpy mouse
    ... kill -TERM pid ... to do with graphics card and driver. ...
    (Fedora)
  • Re: how can I make sure only one instance of gkrellm runs
    ... It is the standard way of probing for a process given a pid. ... "man 3p kill" says: ... since the script is executing the command ... But for a single person running a single GUI ...
    (Fedora)
  • RE: threads in perl
    ... Instead of xterm I tried to invoke some other script: ... How can I kill exec after it was started in different thread? ... But threads all share the same pid, ... When life conspires against you, and no longer floats your boat, Don't waste your time with crying, just get on your back and float. ...
    (perl.beginners)
  • Re: Killing a process tree? - 1 attachment
    ... Well, you could use ps to get process and parent process pid, ... match subprocess to parent process, and kill in reverse order. ...
    (alt.os.linux)
  • trap not work in program with a subshell environment
    ... print "killed $PID." ... trap handle_signal INT TERM ... And here is the process tree. ... If I kill the second "1.ksh", ...
    (comp.unix.shell)