How to run 'feh' in the background of a script?

Matt Graham danceswithcrows at usa.net
Tue Oct 2 11:14:58 MST 2012


From: joe at actionline.com
> I'd like to be able to use something like this:
> feh -x -g 400x400 image.jpg; kwrite textfile.txt <E>
> 
> And have the image remain on the screen while kwrite opens the text
> file for editing.

Something like this:

#!/bin/bash
display image.jpg &
kwrite textfile.txt
# end of script

...in bash, putting an & at the end of a line tells the shell "run this
process in the background".  You can see this working in the old-school
.xinitrc files that would start various X clients with & before starting the
window manager without &.

The snippet above will display image.jpg , but when you quit kwrite, the
script will reach its end and exit.  The background processes that the script
started will receive a HUP when the script exits.  So when you quit kwrite,
the display process will get HUPped and exit too.

-- 
Matt G / Dances With Crows
The Crow202 Blog:  http://crow202.org/wordpress/
There is no Darkness in Eternity/But only Light too dim for us to see



More information about the PLUG-discuss mailing list