Quantcast
Channel: Bash OR operator - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 2

Bash OR operator

$
0
0

My script is working with this:

if pgrep -f "/home/tiger/bin/pymp">/dev/null 2>&1 ; then

I want it to check for mpv2 also.

This is what I have so far:

if [[ /usr/bin/pgrep -f "/home/tiger/bin/pymp" ]] || [[ /usr/bin/pgrep -f "/usr/bin/mpv2" ]] >/dev/null 2>&1; then

These are the errors I'm seeing:

/home/tiger/bin/pauseMusic.sh: line 3: conditional binary operator expected/home/tiger/bin/pauseMusic.sh: line 3: syntax error near -f'/home/tiger/bin/pauseMusic.sh: line 3:if [[ /usr/bin/pgrep -f "/home/tiger/bin/pymp" ]] || [[ /usr/bin/pgrep -f "/usr/bin/mpv2" ]] >/dev/null 2>&1; then'


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images