0

The following command (get process name) works for me

ps -q $$ -o comm=

bash

But once I try to assign to variable, it does not work

processname=ps -q $$ -o comm=

-q: command not found

Why is that?

Tomas Kubes
  • 23,880
  • 18
  • 111
  • 148
  • 1
    https://unix.stackexchange.com/questions/440088/what-is-command-substitution-in-a-shell you need to use command substitution if you want the command to be substituted by its output – erik258 Jan 27 '23 at 16:57

0 Answers0