[Gambas-user] donot permit another instance of my program

Tobias Boege taboege at gmail.com
Thu May 31 18:42:49 CEST 2018


On Thu, 31 May 2018, PICCORO McKAY Lenz wrote:
> good anwers Tobi, but also too complicated:
> 
> ps -lxa | grep " & nameproc & " | sed 's/   */ /g' | cut -d' ' -f3,13,14,15
> 
> nameproc must have the first char close inside "[" "]" and that's all
> 

ps and pgrep come in the same package, procps. It was brought up here that
pgrep might not be installed on your system. If you are worried about that,
you can't rely on ps either. pgrep will be missing if and only if ps is
missing.

Also, email headers tell me that you took shortly under 1 minute to read
my email and write your reply. I know you are always in a hurry, but there
is a big paragraph in my message which advises against using `pgrep` or
`ps | grep` in the first place. For the sake of others interested in
this subject here, don't just say "yours is too complicated, I already
have X", right after I brought up reasons against "X".

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk


More information about the User mailing list