Categories
Linux Mastering Development

Why does this variable assigned ZERO have the value TWO

I am trying to create a script that populates a variable with zero when a process called ‘enigma2’ does not exist. When I run this script… #!/bin/sh ENIGMA_PID=$(ps ax|grep enigma2|grep -v grep|wc -l | awk ‘{print $1}’) echo $ENIGMA_PID echo “$ENIGMA_PID” I get the output… 0 0 Which is what I expect. But when I […]

Categories
Linux Mastering Development

Why does this variable assigned ZERO have the value TWO

I am trying to create a script that populates a variable with zero when a process called ‘enigma2’ does not exist. When I run this script… #!/bin/sh ENIGMA_PID=$(ps ax|grep enigma2|grep -v grep|wc -l | awk ‘{print $1}’) echo $ENIGMA_PID echo “$ENIGMA_PID” I get the output… 0 0 Which is what I expect. But when I […]

Categories
Linux Mastering Development

Why does this variable assigned ZERO have the value TWO

I am trying to create a script that populates a variable with zero when a process called ‘enigma2’ does not exist. When I run this script… #!/bin/sh ENIGMA_PID=$(ps ax|grep enigma2|grep -v grep|wc -l | awk ‘{print $1}’) echo $ENIGMA_PID echo “$ENIGMA_PID” I get the output… 0 0 Which is what I expect. But when I […]

Categories
Linux Mastering Development

Why does this variable assigned ZERO have the value TWO

I am trying to create a script that populates a variable with zero when a process called ‘enigma2’ does not exist. When I run this script… #!/bin/sh ENIGMA_PID=$(ps ax|grep enigma2|grep -v grep|wc -l | awk ‘{print $1}’) echo $ENIGMA_PID echo “$ENIGMA_PID” I get the output… 0 0 Which is what I expect. But when I […]

Categories
Linux Mastering Development

Why does this variable assigned ZERO have the value TWO

I am trying to create a script that populates a variable with zero when a process called ‘enigma2’ does not exist. When I run this script… #!/bin/sh ENIGMA_PID=$(ps ax|grep enigma2|grep -v grep|wc -l | awk ‘{print $1}’) echo $ENIGMA_PID echo “$ENIGMA_PID” I get the output… 0 0 Which is what I expect. But when I […]

Categories
Linux Mastering Development

Why does this variable assigned ZERO have the value TWO

I am trying to create a script that populates a variable with zero when a process called ‘enigma2’ does not exist. When I run this script… #!/bin/sh ENIGMA_PID=$(ps ax|grep enigma2|grep -v grep|wc -l | awk ‘{print $1}’) echo $ENIGMA_PID echo “$ENIGMA_PID” I get the output… 0 0 Which is what I expect. But when I […]