Re: lua+pgrep

2009-06-25 Thread Julien Danjou
At 1245863677 time_t, Alex Cornejo wrote: The problem is that if we do os.execute(pgrep -f pyscript) from lua, it will always return a process, even if pyscript is not running. Actually, you can do os.execute(pgrep -f blablafoofoobar) and it will always find a process. Weird huh? Any ideas on

Re: lua+pgrep

2009-06-25 Thread Alex Cornejo
Yup, I actually pinned down the problem now, I think its a bug in pgrep. You instance pgrep -f someprogname and pgrep first queries the system for a list of processes with their respective command lines, then iterates over each process and searches for the substring someprogname inside each

Re: lua+pgrep

2009-06-25 Thread Julien Danjou
At 1245953624 time_t, Alex Cornejo wrote: Any ideas? Namely I wanted to implement a startup module for awesome which has a list of programs you would like to run when awesome start, but only runs them if they are not already running (to avoid problems when restarting awesome for example). This

Re: lua+pgrep

2009-06-25 Thread Andrei Thorp
Don't use pgrep (ps and grep may have better results)? Write the programs you started to a file and delete them after awesome completes (like, after in the .xinitrc)? -- Andrei Thorp, Developer: Xandros Corp. (http://www.xandros.com) -- To unsubscribe, send mail to

lua+pgrep

2009-06-24 Thread Alex Cornejo
Hi ppl, Suppose you want to code something in lua that needs to check if xterm is running, a quick way to do that in bash would be pgrep xterm. However, sometimes you want to check for a program that use an interpreter. For example suppose you have a python script call pyscript, if you run pgrep