You are not logged in.
Pages: 1
Hi, I'm writing a bash script to use with a DSLR camera as a remote control.
One of the modes I thought of was something like "shoot every X seconds for Y minutes". So at first I thought of doing simple maths to calculate the number of times the script would run. But then I remembered long exposures. If you have set your camera up for firing 5 seconds, then the camera remote would have to wait 5 additional seconds and so it wouldn't be running for the specified minutes.
Then I came up with something like "getting own pid". I mean, before the loop I'll have something like:
(sleep $1 ; kill -9 $PID) &
And then run the loop normally, firing the camera.
By the way, it would also be great to get the pid of another process. Everytime the script fires a shot, it opens 'feh' for previewing, so I'd also like to be able to get this pid.
Thanks in advance!
PS: Sorry for my bad english, I'm spanish ^^'
Last edited by jdiez (2009-08-06 16:07:05)
Offline
Try the pidof command seems like what you want.
eg:
[mark@markspc ~]$ pidof firefox
1205
[mark@markspc ~]$
Last edited by markp1989 (2009-08-05 22:58:27)
Desktop: E8400@4ghz - DFI Lanparty JR P45-T2RS - 4gb ddr2 800 - 30gb OCZ Vertex - Geforce 8800 GTS - 2*19" LCD
Server/Media Zotac GeForce 9300-ITX I-E - E5200 - 4gb Ram - 2* ecogreen F2 1.5tb - 1* wd green 500gb - PicoPSU 150xt - rtorrent - xbmc - ipazzport remote - 42" LCD
Offline
Thanks, markp1989!
Would that work if I called it with something like PID = `pidof feh --scale /photos/jpeg/$1.jpg` ?
Offline
Then I came up with something like "getting own pid".
echo $$
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Thanks fukawi! That worked perfectly.
Offline
But I still don't know how to find the pid for a feh run with some settings, like
feh --scale whatever.png
Offline
But I still don't know how to find the pid for a feh run with some settings, like
feh --scale whatever.png
pgrep -f "feh --scale whatever.png"
Offline
thanks so much! that just did it!
Offline
Pages: 1