Relevance to find process without parameters

Apologies for the beginners question.

I am looking for the relevance to find the process without parameters.
Please see sample output from the ps command - would like dhclient at with process id 13248 to match the relevance (it has no parameters) and not to match for the process with process id 3260 (it has parameters).

[root@myhostname ~]# ps -ef | grep dhc
root 3260 1 0 2017 ? 00:00:00 /sbin/dhclient -1 -q -lf /var/lib/dhclient/dhclient–eth0.lease -pf /var/run dhclient-eth0.pid -H myhostname eth0
root 11707 11547 0 20:50 pts/0 00:00:00 grep --color=auto dhc
root 13248 1 0 2017 ? 00:00:00 dhclient
[root@myhostname ~]#

This discussion seems related to my question:
Finding command line argument that contains [Finding command line argument that contains]

Adding my attempts ( unsuccessful :frowning: ) in hope that someone can fix the syntax:

Q: command line arguments of process “dhclient” whose (it as string as trimmed string != “” )
E: This expression contained a character which is not allowed.

Q: command line arguments of process “dhclient” whose (it as string as trimmed string != “” )
E: The operator “string” is not defined.

Q: command line arguments of process “dhclient” whose (it = “” )
E: The operator “equal” is not defined.

Q: command line arguments of process “dhclient” whose (it as string as trimmed string = “” )
E: The operator “string” is not defined.

Q: command line arguments of process “dhclient” whose (value as string = “” )
E: The operator “value” is not defined.

Q: command line arguments of process “dhclient” whose (it as string = “” )
E: The operator “string” is not defined.

Thank you,
Aleksandr

No need to apologize for a beginners question! Sorry that nobody responded to you on here!

So it seems like your first issue is a misunderstanding of types and order of operations.

To start i’d recommend trying Fixlet Debugger on Windows for the following examples with, “Show Type Information” enabled under view:

Q: name of file whose (it = "pagefile.sys") of folder "C:\"
E: The operator "equal" is not defined.

The issue here is the order of operations – “whose” applies to the object directly to the left of “whose”, in this case it is file of folder "C:\" and not name of file of folder "C:\" in other words, “whose” takes precedent over “name of” and gets evaluated first. The reason this is important is because of your relevance statement:

command line arguments of process "dhclient" whose (it = "" )

We can get a better idea if we translate this using parentheses – you’re essentially asking for:

command line arguments of (process "dhclient" whose (it = "" ))

We can now see that this doesn’t make sense – we want command line arguments that equal nothing, not a process that equals nothing.

So the first change to make would be to move the whose to the right spot:

command line arguments whose (it = “” ) of process “dhclient”

Now I don’t have a linux box immediately available to figure out the exact remaining relevance statement but if you start with:

command line arguments of process "dhclient"

That should print what the current result is and then you can adjust your new whose statement to match the case you are looking for.

If you want additional help, run command line arguments of process "dhclient" in QnA on a computer and let us know what it returns and what you want to check for – the output of ps -ef isnt terribly helpful we will want the output of that command line arguments command.

Thank you for suggestion!
I have learned a little more now and can post some useful (hopefully) information - trying to implement your idea.

A) Start the “vi” process without parameters

[root@devctlvhadapp11 ~]# vi &
[1] 92337
[root@devctlvhadapp11 ~]#
[root@devctlvhadapp11 ~]# ps -ef | grep vi
root 92337 91158 0 14:14 pts/0 00:00:00 vi
root 92349 91158 0 14:16 pts/0 00:00:00 grep vi
[root@devctlvhadapp11 ~]#

B) Use qna, it works as expected

[root@devctlvhadapp11 ~]# /opt/BESClient/bin/qna
Default masthead location, using /etc/opt/BESClient/actionsite.afxm
Q: command line arguments of process “vi” as string
T: 9224

Q: exists (command line arguments of process “vi” as string )
A: False
T: 5469

Q: not exist (command line arguments of process “vi” as string )
A: True
T: 4597

Q: not exist (command line arguments of process “vi”)
A: True
T: 5202

Q: exists (command line arguments of process “vi” )
A: False
T: 5672

Thank you,
Aleksandr

PS A little more complicated - I have 2 dhclient processes (not just one “vi” process as in example above). Relevance for “vi” worked fine above, but stopped working after the second “vi” process was started.

[root@devctlvhadapp11 ~]# ps -ef | grep dhc
root 1299 1 0 Jul11 ? 00:00:00 /sbin/dhclient -H devctlvhadapp11 -1 -q -cf /etc/dhcp/dhclient-eth0.conf -lf /var/lib/dhclient/dhclient-eth0.leases -pf /var/run/dhclient-eth0.pid eth0
root 1382 1 0 Jul11 ? 00:00:00 /sbin/dhclient -H devctlvhadapp11 -1 -q -cf /etc/dhcp/dhclient-eth1.conf -lf /var/lib/dhclient/dhclient-eth1.leases -pf /var/run/dhclient-eth1.pid eth1
root 92385 91158 0 14:21 pts/0 00:00:00 grep dhc
[root@devctlvhadapp11 ~]#
Default masthead location, using /etc/opt/BESClient/actionsite.afxm
Q: exists process "dhclient"
A: True
T: 7346

Q: not exists (command line arguments of it ) of process "vi"
A: True
T: 4760

Q: not exists (command line arguments of it ) of process "dhclient"
E: Singular expression refers to non-unique object.
T: 3557

Adding second “vi” - relevance stops working:
[root@devctlvhadapp11 ~]# ps -ef | grep vi
root 92337 91158 0 14:14 pts/0 00:00:00 vi
root 92429 91158 0 14:27 pts/0 00:00:00 grep vi
[root@devctlvhadapp11 ~]# vi &
[2] 92431
[root@devctlvhadapp11 ~]# ps -ef | grep vi
root 92337 91158 0 14:14 pts/0 00:00:00 vi
root 92431 91158 0 14:27 pts/0 00:00:00 vi
root 92433 91158 0 14:27 pts/0 00:00:00 grep vi

[2]+ Stopped vi
[root@devctlvhadapp11 ~]# /opt/BESClient/bin/qna
Default masthead location, using /etc/opt/BESClient/actionsite.afxm
Q: not exists (command line arguments of it ) of process "vi"
E: Singular expression refers to non-unique object.
T: 8658

Singular expression refers to non-unique object.

You have a singular expression (process "vi") which refers to a non-unique object (the two/three vi processes).

You need some plurals -

This might work -

pid of it, exists command line arguments of it) of processes "vi"

If not, try

pid of it, exists command line arguments of it) of processes whose (name of it = "vi")
Or
pid of it, exists command line arguments of it) of processes whose (process name of it = "vi")