Compile and try to run twice.
Code:
Procedure GetRunningProgramm(prog.s)
Protected RegEx.i = CreateRegularExpression(#PB_Any, "[0-9]+")
Protected Directory.s = "/proc"
Protected ExamDir.i = ExamineDirectory(#PB_Any, Directory, "*.*")
Protected OutFile.i
Protected Sum.i=0
If RegEx And ExamDir
While NextDirectoryEntry(ExamDir)
If MatchRegularExpression(RegEx, DirectoryEntryName(ExamDir))
OutFile = ReadFile(#PB_Any,Directory+"/"+DirectoryEntryName(ExamDir)+"/cmdline")
If OutFile
If FindString(ReadString(OutFile), prog, 1)
Sum + 1
EndIf
CloseFile(OutFile)
EndIf
EndIf
Wend
FinishDirectory(ExamDir)
EndIf
ProcedureReturn Sum
EndProcedure
If GetRunningProgramm(ProgramFilename())>1
MessageRequester("","yes working")
Else
MessageRequester("","no working")
EndIf
ps -aux Works on the same principle
